A Requirements file gives you a way to create an environment where you can put all optional dependencies which are needed for your Project/Application.
To get started with Django-admin-tools-stats you must have the following installed:
Use PIP to install all the requirements,:
$ pip install -r requirements.txt
Configure admin_tools
Add admin_tools_stats & chart_tools into INSTALLED_APPS in settings.py:
INSTALLED_APPS = (
...
'admin_tools_stats',
'chart_tools',
...)
Add following code to 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
if request.POST.get('select_box_'+i.graph_key):
kwargs['select_box_'+i.graph_key] = request.POST['select_box_'+i.graph_key]
self.children.append(DashboardCharts(**kwargs))
Do manage.py syncdb
Open admin panel, Configure Dashboard Stats Criteria & Dashboard Stats respectively