Django Admin Tools Stats Documentation!¶
Release: | 0.7.1 |
---|---|
Date: | Oct 05, 2017 |
Keywords: | django, python, plot, graph, nvd3, d3, dashboard |
Author: | Arezqui Belaid |
Description: | Django-admin-tools-stats is a Django admin module that allow you to create easily charts on your dashboard based on specific models and criterias. |
Contents:
Introduction¶
Version: | 0.7.1 |
---|---|
Date: | Oct 05, 2017 |
Keywords: | django, python, plot, graph, nvd3, d3, dashboard |
Author: | Arezqui Belaid |
License: | MIT |
–
Django-admin-tools-stats is a Django admin module that allows you to easily create charts on your dashboard based on specific models and criterias.
It will query your models and provide reporting and statistics graphs, simple to read and display on your Dashboard.
Django-admin-tools-stats is an open source project written in Python and using the Django
Framework.
Overview¶
Django-admin-tools-stats is a Django application which powers dashboard modules with customer statistics and charts.
The goal of this project is to quickly interrogate your model data to provide reports and statistics graphs which are simple to read and can be used on a Dashboard.

Installation¶
Install, upgrade and uninstall django-nvd3.py with these commands:
$ sudo pip install django-admin-tools-stats
$ sudo pip install --upgrade django-admin-tools-stats
$ sudo pip uninstall django-admin-tools-stats
Or if you don’t have pip:
$ sudo easy_install django-admin-tools-stats
Usage¶
These tools have been created to improve the django-admin-tools : http://django-admin-tools.readthedocs.org
With Django-admin-tools you will be able to create and include charts on your dashboard and monitor your data, for instance you can easily monitor new users signing up each day, or new campaigns created per week.
Django-admin-tools also allow you to display a button ‘Select’ that will behave as a filter on the model data.
Contributing¶
Development of django-admin-tools-stats takes place on Github:
https://github.com/Star2Billing/django-admin-tools-stats
Bug tracker: https://github.com/Star2Billing/django-admin-tools-stats/issues
Source download¶
The source code is currently available on github. Fork away!
https://github.com/Star2Billing/django-admin-tools-stats
Available also on PyPi : https://pypi.python.org/pypi/django-admin-tools-stats
Documentation¶
Find the project documentation : http://django-admin-user-stats.readthedocs.org
Credits¶
Django-admin-tools-stats was inspired by django-admin-user-stats : https://github.com/kmike/django-admin-user-stats
License¶
Copyright (c) 2011-2014 Arezqui Belaid <areski@gmail.com>
Django-nvd3 is licensed under MIT, see MIT-LICENSE.txt.
Installation overview¶
Install requirements¶
To get started with Django-admin-tools-stats you must have the following installed:
- Django Framework >= 1.4 (Python based Web framework)
- python-dateutil >= 1.5 (Extensions to the standard datetime module)
- django-admin-tools (Collection of tools for Django administration)
- django-cache-utils (To provide utilities for making cache-related work easier)
- django-jsonfield >= 0.6 (Reusable Django field that can use inside models)
- django-nvd3 >= 0.5.0 (Django wrapper for nvd3 - It’s time for beautiful charts)
- python-memcached >= 1.47 (Python based API for communicating with the memcached
distributed memory object cache daemon)
Use PIP to install the dependencies listed in the requirments file,:
$ pip install -r requirements.txt
Configuration¶
Configure django-admin-tools, refer to the documentation of http://django-admin-tools.readthedocs.org/en/latest/
Add
admin_tools_stats
&django_nvd3
into INSTALLED_APPS in settings.py:INSTALLED_APPS = ( 'admin_tools_stats', 'django_nvd3', )
Add the following code to your file dashboard.py:
from admin_tools_stats.modules import DashboardCharts, get_active_graph # append an app list module for "Country_prefix" self.children.append(modules.AppList( _('Dashboard Stats Settings'), models=('admin_tools_stats.*', ), )) # Copy following code into your custom dashboard # append following code after recent actions module or # a link list module for "quick links" graph_list = get_active_graph() for i in graph_list: kwargs = {} kwargs['graph_key'] = i.graph_key kwargs['require_chart_jscss'] = False if context['request'].POST.get('select_box_' + i.graph_key): kwargs['select_box_' + i.graph_key] = context['request'].POST['select_box_' + i.graph_key] self.children.append(DashboardCharts(**kwargs))
To create the tables needed by Django-admin-tools-stats, run the following command:
$ python manage.py syncdb
Open admin panel, configure
Dashboard Stats Criteria
&Dashboard Stats
respectively
Developer Documentation¶
Contents:
Prerequisites¶
- To fully understand this project, developers will need to have an advanced knowledge of:
- Django : http://www.djangoproject.com/
- Python : http://www.python.org/
Objects Description¶
DashboardStatsCriteria
¶
To configure criteria for dashboard graphs
Attributes:
criteria_name
- Unique word .criteria_fix_mapping
- JSON data key-value pairs.dynamic_criteria_field_name
- Dynamic criteria field.criteria_dynamic_mapping
- JSON data key-value pairs.created_date
- record created date.updated_date
- record updated date.Name of DB table: dash_stats_criteria
DashboardStats
¶
To configure graphs for dashboard
Attributes:
graph_key
- unique graph name.graph_title
- graph title.model_app_name
- App name of model.model_name
- model name.date_field_name
- Date field of model_name.criteria
- many-to-many relationship.is_visible
- enable/disable.created_date
- record created date.updated_date
- record updated date.Name of DB table: dashboard_stats
Django-admin-tools-stats Modules¶
DashboardChart
¶
Dashboard module with user registration charts. Default values are best suited for 2-column dashboard layouts.
- def get_registrations(self, interval, days, graph_key, select_box_value):
- Returns an array with new users count per interval.
- def prepare_template_data(self, data, graph_key, select_box_value):
- Prepares data for template (passed as module attributes)
DashboardCharts
¶
Group module with 3 default dashboard charts