Code Monkey home page Code Monkey logo

django-admin-tools-stats's Introduction

NOTE: This project was rewritten to be more flexible and to work with common Django admin and released as django-admin-charts. The django-admin-charts project is backward-compatible with django-admin-tools-stats, so you can migrate to that. All development and maintanence continues on django-admin-charts repository.

Django-admin-tools-stats

Description:Django-admin module to create charts and stats in your dashboard
Documentation:http://django-admin-tools-stats.readthedocs.org/en/latest/
https://travis-ci.org/areski/django-admin-tools-stats.svg?branch=master Latest Version Downloads Supported Python versions License

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.

It will query your models and provide reporting and statistics graphs, simple to read and display on your Dashboard.

https://github.com/areski/django-admin-tools-stats/raw/master/docs/source/_static/admin_dashboard.png

Installation

Install, upgrade and uninstall django-admin-tools-stats with these commands:

$ pip install django-admin-tools-stats

Dependencies

django-admin-tools-stats is a django based application, the major requirements are :

  • python-dateutil
  • django-jsonfield
  • django-qsstats-magic
  • django-cache-utils
  • django-admin-tools
  • django-nvd3
  • django-bower

Configure

  • Configure admin_tools

  • Configure django-bower

    • Add django-bower to INSTALLED_APPS in settings.py:

      INSTALLED_APPS = (
          ...
          'djangobower'
      )
      
    • Add the following properties to you settings.py file:

      # Specifie path to components root (you need to use absolute path)
      BOWER_COMPONENTS_ROOT = os.path.join(PROJECT_ROOT, 'components')
      
      
      BOWER_INSTALLED_APPS = (
          'jquery#3.4.1',
          'jquery-ui#1.12.1',
          'd3#3.3.13',
          'nvd3#1.7.1',
      )
      
    • Add django-bower finder to your static file finders:

      STATICFILES_FINDERS = (
          ...
          'djangobower.finders.BowerFinder',
      )
      
    • Run the following commands. These will download nvd3.js and its dependencies using bower and throw them in to you static folder for access by your application:

      $ python manage.py bower_install
      $ python manage.py collectstatic
      
  • Add admin_tools_stats & django_nvd3 into INSTALLED_APPS in settings.py:

    INSTALLED_APPS = (
        ...
        'admin_tools_stats',
        'django_nvd3',
    )
    
  • Add following code to dashboard.py:

    from admin_tools_stats.modules import DashboardCharts, get_active_graph
    
    # append an app list module
    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['require_chart_jscss'] = True
        kwargs['graph_key'] = i.graph_key
    
        for key in context['request'].POST:
            if key.startswith('select_box_'):
                kwargs[key] = context['request'].POST[key]
    
        self.children.append(DashboardCharts(**kwargs))
    
  • To create the tables needed by Django-admin-tools-stats, run the following command:

    $ python manage.py syncdb
    
  • You may also need to add some includes to your template admin base, see an example on the demo project:

    demoproject/demoproject/templates/admin/base_site.html

  • Open admin panel, configure Dashboard Stats Criteria & Dashboard Stats respectively

Contributing

If you've found a bug, add a feature or improve django-admin-tools-stats and think it is useful then please consider contributing. Patches, pull requests or just suggestions are always welcome!

Source code: http://github.com/areski/django-admin-tools-stats

Bug tracker: https://github.com/areski/django-admin-tools-stats/issues

Documentation

Documentation is available on 'Read the Docs': http://readthedocs.org/docs/django-admin-tools-stats/

License

Copyright (c) 2011-2017 Star2Billing S.L. <[email protected]>

django-admin-tools-stats is licensed under MIT, see MIT-LICENSE.txt.

django-admin-tools-stats's People

Contributors

abarax avatar andybak avatar areski avatar aryanbaghi avatar asilvino avatar avaneesh23 avatar dxist avatar gannetson avatar hbkfabio avatar jonathan-roper avatar petrdlouhy avatar reduxionist avatar rryanburton avatar shrenik avatar vdboor avatar yihuang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

django-admin-tools-stats's Issues

Dynamic criteria doesn't respect lookup data types

It is not possible to set datatypes of the dynamic criteria lookup values. So lookups with keys like __isnull or IDs aren't working very well.

I think, that the dynamic criteria aren't very well designed. I was trying to experiment with behaviour similar to how list_filters are working in django-admin (at least if the criteria values list is blank), but I didn't figure it out yet.

Change to new chart api

Hi, tanks for the amazing app, I am really happy with this.
Is there any plan to go for the new google chart api, there are amazing features over the new release.
Thanks!
Elio

Admin page does not render with changes to dashboard.py

I get the error, "global name 'request' is not defined"

And the error happens in dashboard.py,

At this line -> if request.POST.get('select_box_'+i.graph_key):

I'm doubtful as to how the 'request' parameter would be passed to the init function in dashboard.py , can you please confirm if your instructions for adding code to dashboard.py are correct.

graph doesn't show anythig

Hi
Hope you are doing well
I have install django-admin-tools-stats and there is no error but it shows frame of chart in admin dashboard but it doesn't show curves.
thnak you

How to view the Dashboard?

So I have installed everything as per the instructions, and I am getting the stats and stats criteria tables, but there are a couple of things I am not able to figure out

  1. Can you point me to some more documentation on how to configure the two tables(What do they do)?
  2. How do I access the dashboard for the panel?

I would be more than happy to contribute to any documentation I can.

Thanks,
Avneesh

incompatibility with django 1.5

in modules.py it would be nice to change
import:
from django.contrib.auth.models import User
to:
from django.contrib.auth import get_user_model
User=get_user_model()

Installation Problem

Hi there,

First of all, thanks for this project. It seems awesome.

I'm having trouble to install it. I don't know where to put the snippet you say that must go into dashboard.py. I mean, your snippet has a reference to a request, but nowhere in dashboard.py is that variable.

raise AppRegistryNotReady("Apps aren't loaded yet.")

hello.
after editing /usr/local/lib/python2.7/dist-packages/admin_tools/dashboard/dashboards.py and adding from admin_tools_stats.modules import DashboardCharts, get_active_graph
i get an error that tell me:
raise AppRegistryNotReady("Apps aren't loaded yet.")
app was installed and tables were created i i can see them in admin panel and i can create object from them and set parameters for them ... .
i use from django 1.11 and python 2.7 .both of them are updated to lastest version.
regards.

TTP/1.1" 304 0 [02/Mar/2018 10:08:05] "GET /static/admin_tools/js/jquery/jquery.dashboard.js HT TP/1.1" 304 0 [02/Mar/2018 10:08:06] "GET /static/admin_tools/js/dashboard.js HTTP/1.1" 304 0 Not Found: /favicon.ico [02/Mar/2018 10:08:06] "GET /favicon.ico HTTP/1.1" 404 10295 [02/Mar/2018 10:08:12] "GET /admin_tools_stats/dashboardstats/ HTTP/1.1" 200 111 52 [02/Mar/2018 10:08:12] "GET /jsi18n/ HTTP/1.1" 200 11084 [02/Mar/2018 10:08:13] "GET /static/admin/img/tooltag-add.svg HTTP/1.1" 304 0 [02/Mar/2018 10:08:18] "GET /admin_tools_stats/dashboardstats/add/ HTTP/1.1" 200 16505 [02/Mar/2018 10:08:19] "GET /jsi18n/ HTTP/1.1" 200 11084 [02/Mar/2018 10:08:19] "GET /static/admin/img/icon-addlink.svg HTTP/1.1" 304 0 [02/Mar/2018 10:08:32] "GET /admin_tools_stats/dashboardstatscriteria/ HTTP/1.1" 200 11255 [02/Mar/2018 10:08:32] "GET /jsi18n/ HTTP/1.1" 200 11084 [02/Mar/2018 10:08:35] "GET /admin_tools_stats/dashboardstatscriteria/add/ HTTP/ 1.1" 200 13235 [02/Mar/2018 10:08:35] "GET /jsi18n/ HTTP/1.1" 200 11084 [02/Mar/2018 10:08:52] "POST /admin_tools_stats/dashboardstatscriteria/add/ HTTP /1.1" 302 0 [02/Mar/2018 10:08:53] "GET /admin_tools_stats/dashboardstatscriteria/ HTTP/1.1" 200 13422 [02/Mar/2018 10:08:53] "GET /jsi18n/ HTTP/1.1" 200 11084 [02/Mar/2018 10:08:54] "GET /static/admin/img/icon-yes.svg HTTP/1.1" 304 0 [02/Mar/2018 10:08:54] "GET /static/admin/img/sorting-icons.svg HTTP/1.1" 304 0 [02/Mar/2018 10:09:02] "GET /admin_tools_stats/dashboardstatscriteria/ HTTP/1.1" 200 13196 [02/Mar/2018 10:09:03] "GET /jsi18n/ HTTP/1.1" 200 11084 [02/Mar/2018 10:09:05] "GET /admin_tools_stats/dashboardstats/ HTTP/1.1" 200 111 52 [02/Mar/2018 10:09:05] "GET /jsi18n/ HTTP/1.1" 200 11084 [02/Mar/2018 10:09:09] "GET /admin_tools_stats/dashboardstats/add/ HTTP/1.1" 200 16542 [02/Mar/2018 10:09:09] "GET /jsi18n/ HTTP/1.1" 200 11084 [02/Mar/2018 10:09:54] "POST /admin_tools_stats/dashboardstats/add/ HTTP/1.1" 20 0 16899 [02/Mar/2018 10:09:55] "GET /jsi18n/ HTTP/1.1" 200 11084 [02/Mar/2018 10:10:02] "POST /admin_tools_stats/dashboardstats/add/ HTTP/1.1" 30 2 0 [02/Mar/2018 10:10:03] "GET /admin_tools_stats/dashboardstats/ HTTP/1.1" 200 139 33 [02/Mar/2018 10:10:03] "GET /jsi18n/ HTTP/1.1" 200 11084 [02/Mar/2018 10:10:08] "GET /admin_tools_stats/dashboardstats/1/change/ HTTP/1.1 " 200 16808 [02/Mar/2018 10:10:08] "GET /jsi18n/ HTTP/1.1" 200 11084 [02/Mar/2018 10:10:17] "POST /admin_tools_stats/dashboardstats/1/change/ HTTP/1. 1" 302 0 [02/Mar/2018 10:10:17] "GET /admin_tools_stats/dashboardstats/ HTTP/1.1" 200 139 37 [02/Mar/2018 10:10:18] "GET /jsi18n/ HTTP/1.1" 200 11084 [02/Mar/2018 10:10:23] "GET / HTTP/1.1" 200 10313 [02/Mar/2018 10:10:27] "GET /admin_tools_stats/dashboardstats/ HTTP/1.1" 200 137 23 [02/Mar/2018 10:10:28] "GET /jsi18n/ HTTP/1.1" 200 11084 [02/Mar/2018 10:10:32] "GET /admin_tools_stats/dashboardstats/1/change/ HTTP/1.1 " 200 16808 [02/Mar/2018 10:10:33] "GET /jsi18n/ HTTP/1.1" 200 11084 Unhandled exception in thread started by <function wrapper at 0x7fbf6578eed8> Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/django/utils/autoreload.py", line 230, in wrapper _exception = sys.exc_info() AttributeError: 'NoneType' object has no attribute 'exc_info' Unhandled exception in thread started by <function wrapper at 0x7f76882b7500> Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/django/utils/autoreload.py", line 228, in wrapper fn(*args, **kwargs) File "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/r unserver.py", line 117, in inner_run autoreload.raise_last_exception() File "/usr/local/lib/python2.7/dist-packages/django/utils/autoreload.py", line 251, in raise_last_exception six.reraise(*_exception) File "/usr/local/lib/python2.7/dist-packages/django/utils/autoreload.py", line 228, in wrapper fn(*args, **kwargs) File "/usr/local/lib/python2.7/dist-packages/django/__init__.py", line 27, in setup apps.populate(settings.INSTALLED_APPS) File "/usr/local/lib/python2.7/dist-packages/django/apps/registry.py", line 85 , in populate app_config = AppConfig.create(entry) File "/usr/local/lib/python2.7/dist-packages/django/apps/config.py", line 94, in create module = import_module(entry) File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module __import__(name) File "/usr/local/lib/python2.7/dist-packages/admin_tools/dashboard/__init__.py ", line 1, in <module> from admin_tools.dashboard.dashboards import * File "/usr/local/lib/python2.7/dist-packages/admin_tools/dashboard/dashboards. py", line 21, in <module> from admin_tools_stats.modules import DashboardCharts, get_active_graph File "/usr/local/lib/python2.7/dist-packages/admin_tools_stats/modules.py", li ne 26, in <module> from admin_tools_stats.models import DashboardStats File "/usr/local/lib/python2.7/dist-packages/admin_tools_stats/models.py", lin e 35, in <module> class DashboardStatsCriteria(models.Model): File "/usr/local/lib/python2.7/dist-packages/django/db/models/base.py", line 1 10, in __new__ app_config = apps.get_containing_app_config(module) File "/usr/local/lib/python2.7/dist-packages/django/apps/registry.py", line 24 7, in get_containing_app_config self.check_apps_ready() File "/usr/local/lib/python2.7/dist-packages/django/apps/registry.py", line 12 5, in check_apps_ready raise AppRegistryNotReady("Apps aren't loaded yet.") django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet. mohsen@win-t:~/ztn$ python manage.py runserver 0.0.0.0:8000 > 1.txt Unhandled exception in thread started by <function wrapper at 0x7f42ecc2e410> Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/django/utils/autoreload.py", line 228, in wrapper fn(*args, **kwargs) File "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/runserver.py", line 117, in inner_run autoreload.raise_last_exception() File "/usr/local/lib/python2.7/dist-packages/django/utils/autoreload.py", line 251, in raise_last_exception six.reraise(*_exception) File "/usr/local/lib/python2.7/dist-packages/django/utils/autoreload.py", line 228, in wrapper fn(*args, **kwargs) File "/usr/local/lib/python2.7/dist-packages/django/__init__.py", line 27, in setup apps.populate(settings.INSTALLED_APPS) File "/usr/local/lib/python2.7/dist-packages/django/apps/registry.py", line 85, in populate app_config = AppConfig.create(entry) File "/usr/local/lib/python2.7/dist-packages/django/apps/config.py", line 94, in create module = import_module(entry) File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module __import__(name) File "/usr/local/lib/python2.7/dist-packages/admin_tools/dashboard/__init__.py", line 1, in <module> from admin_tools.dashboard.dashboards import * File "/usr/local/lib/python2.7/dist-packages/admin_tools/dashboard/dashboards.py", line 21, in <module> from admin_tools_stats.modules import DashboardCharts, get_active_graph File "/usr/local/lib/python2.7/dist-packages/admin_tools_stats/modules.py", line 26, in <module> from admin_tools_stats.models import DashboardStats File "/usr/local/lib/python2.7/dist-packages/admin_tools_stats/models.py", line 35, in <module> class DashboardStatsCriteria(models.Model): File "/usr/local/lib/python2.7/dist-packages/django/db/models/base.py", line 110, in __new__ app_config = apps.get_containing_app_config(module) File "/usr/local/lib/python2.7/dist-packages/django/apps/registry.py", line 247, in get_containing_app_config self.check_apps_ready() File "/usr/local/lib/python2.7/dist-packages/django/apps/registry.py", line 125, in check_apps_ready raise AppRegistryNotReady("Apps aren't loaded yet.") django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.

TypeError: render() got an unexpected keyword argument 'renderer'

Not sure if it`s my fault and I missed smth or an issue...
I am getting this from django when trying to add criteria:

render() got an unexpected keyword argument 'renderer'
Request Method:	GET
Request URL:	http://localhost:99/admin/admin_tools_stats/dashboardstatscriteria/add/?_to_field=id&_popup=1
Django Version:	2.1.5
Exception Type:	TypeError
Exception Value:	
render() got an unexpected keyword argument 'renderer'
Exception Location:	C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\django\forms\boundfield.py in as_widget, line 93
Python Executable:	C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\python.exe
Python Version:	3.7.0
Python Path:	
['C:\\Users\\admin\\source\\repos\\AppTest\\AppTest',
 '',
 'C:\\Users\\admin\\source\\repos\\AppTest\\AppTest',
 'C:\\Program Files (x86)\\Microsoft Visual '
 'Studio\\Shared\\Python37_64\\python37.zip',
 'C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\Python37_64\\DLLs',
 'C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\Python37_64\\lib',
 'C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\Python37_64',
 'C:\\Program Files (x86)\\Microsoft Visual '
 'Studio\\Shared\\Python37_64\\lib\\site-packages']
Server time:	Wed, 9 Jan 2019 17:25:42 +0000```


And:

```Environment:


Request Method: GET
Request URL: http://localhost:99/admin/admin_tools_stats/dashboardstatscriteria/add/?_to_field=id&_popup=1

Django Version: 2.1.5
Python Version: 3.7.0
Installed Applications:
['app',
 'admin_tools',
 'admin_tools.theming',
 'admin_tools.menu',
 'admin_tools.dashboard',
 'admin_tools_stats',
 'django_nvd3',
 'django.contrib.admin',
 'django.contrib.admindocs',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'django_extensions',
 'table',
 'qr_code',
 'djangobower']
Installed Middleware:
['django.middleware.security.SecurityMiddleware',
 'django.middleware.locale.LocaleMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware']


Template error:
In template C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\django\contrib\admin\templates\admin\includes\fieldset.html, error at line 19
   render() got an unexpected keyword argument 'renderer'
   9 :             {% for field in line %}
   10 :                 <div{% if not line.fields|length_is:'1' %} class="fieldBox{% if field.field.name %} field-{{ field.field.name }}{% endif %}{% if not field.is_readonly and field.errors %} errors{% endif %}{% if field.field.is_hidden %} hidden{% endif %}"{% elif field.is_checkbox %} class="checkbox-row"{% endif %}>
   11 :                     {% if not line.fields|length_is:'1' and not field.is_readonly %}{{ field.errors }}{% endif %}
   12 :                     {% if field.is_checkbox %}
   13 :                         {{ field.field }}{{ field.label_tag }}
   14 :                     {% else %}
   15 :                         {{ field.label_tag }}
   16 :                         {% if field.is_readonly %}
   17 :                             <div class="readonly">{{ field.contents }}</div>
   18 :                         {% else %}
   19 :                              {{ field.field }} 
   20 :                         {% endif %}
   21 :                     {% endif %}
   22 :                     {% if field.field.help_text %}
   23 :                         <div class="help">{{ field.field.help_text|safe }}</div>
   24 :                     {% endif %}
   25 :                 </div>
   26 :             {% endfor %}
   27 :         </div>
   28 :     {% endfor %}
   29 : </fieldset>


Traceback:

File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\django\core\handlers\exception.py" in inner
  34.             response = get_response(request)

File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\django\core\handlers\base.py" in _get_response
  156.                 response = self.process_exception_by_middleware(e, request)

File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\django\core\handlers\base.py" in _get_response
  154.                 response = response.render()

File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\django\template\response.py" in render
  106.             self.content = self.rendered_content

File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\django\template\response.py" in rendered_content
  83.         content = template.render(context, self._request)

File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\django\template\backends\django.py" in render
  61.             return self.template.render(context)

File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\django\template\base.py" in render
  171.                     return self._render(context)

File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\django\template\base.py" in _render
  163.         return self.nodelist.render(context)

File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\django\template\base.py" in render
  937.                 bit = node.render_annotated(context)

File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\django\template\base.py" in render_annotated
  904.             return self.render(context)

File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\django\template\loader_tags.py" in render
  150.             return compiled_parent._render(context)

File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\django\template\base.py" in _render
  163.         return self.nodelist.render(context)

File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\django\template\base.py" in render
  937.                 bit = node.render_annotated(context)

File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\django\template\base.py" in render_annotated
  904.             return self.render(context)

File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\django\template\loader_tags.py" in render
  150.             return compiled_parent._render(context)

File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\django\template\base.py" in _render
  163.         return self.nodelist.render(context)

File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\django\template\base.py" in render
  937.                 bit = node.render_annotated(context)

File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\django\template\base.py" in render_annotated
  904.             return self.render(context)

File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\django\template\loader_tags.py" in render
  150.             return compiled_parent._render(context)

File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\django\template\base.py" in _render
  163.         return self.nodelist.render(context)

File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\django\template\base.py" in render
  937.                 bit = node.render_annotated(context)

File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\django\template\base.py" in render_annotated
  904.             return self.render(context)

File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\django\template\loader_tags.py" in render
  62.                 result = block.nodelist.render(context)

File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\django\template\base.py" in render
  937.                 bit = node.render_annotated(context)

File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\django\template\base.py" in render_annotated
  904.             return self.render(context)

File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\django\template\loader_tags.py" in render
  62.                 result = block.nodelist.render(context)

File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\django\template\base.py" in render
  937.                 bit = node.render_annotated(context)

File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\django\template\base.py" in render_annotated
  904.             return self.render(context)

File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\django\template\defaulttags.py" in render
  209.                     nodelist.append(node.render_annotated(context))

File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\django\template\base.py" in render_annotated
  904.             return self.render(context)

File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\django\template\loader_tags.py" in render
  188.             return template.render(context)

File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\django\template\base.py" in render
  173.                 return self._render(context)

File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\django\template\base.py" in _render
  163.         return self.nodelist.render(context)

File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\django\template\base.py" in render
  937.                 bit = node.render_annotated(context)

File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\django\template\base.py" in render_annotated
  904.             return self.render(context)

File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\django\template\defaulttags.py" in render
  209.                     nodelist.append(node.render_annotated(context))

File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\django\template\base.py" in render_annotated
  904.             return self.render(context)

File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\django\template\defaulttags.py" in render
  209.                     nodelist.append(node.render_annotated(context))

File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\django\template\base.py" in render_annotated
  904.             return self.render(context)

File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\django\template\defaulttags.py" in render
  309.                 return nodelist.render(context)

File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\django\template\base.py" in render
  937.                 bit = node.render_annotated(context)

File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\django\template\base.py" in render_annotated
  904.             return self.render(context)

File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\django\template\defaulttags.py" in render
  309.                 return nodelist.render(context)

File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\django\template\base.py" in render
  937.                 bit = node.render_annotated(context)

File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\django\template\base.py" in render_annotated
  904.             return self.render(context)

File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\django\template\base.py" in render
  993.         return render_value_in_context(output, context)

File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\django\template\base.py" in render_value_in_context
  972.             value = str(value)

File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\django\utils\html.py" in <lambda>
  397.     klass.__str__ = lambda self: mark_safe(klass_str(self))

File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\django\forms\boundfield.py" in __str__
  33.         return self.as_widget()

File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\django\forms\boundfield.py" in as_widget
  93.             renderer=self.form.renderer,

Exception Type: TypeError at /admin/admin_tools_stats/dashboardstatscriteria/add/
Exception Value: render() got an unexpected keyword argument 'renderer'

Thanks!

Documentation and examples

This project has to be one of the worst I have ever come across in terms of documentation and even the starting example doesn't work properly.

Issue - python manage.py makemigrations

I installed django-admin-tools.
Next I am trying to run python manage.py makemigrations
But this gives me an error.

Traceback (most recent call last):
File "manage.py", line 10, in
execute_from_command_line(sys.argv)
File "C:\Users\1130618379\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\management_init_.py", line 371, in execute_from_command_line
utility.execute()
File "C:\Users\1130618379\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\management_init_.py", line 365, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Users\1130618379\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\management\base.py", line 288, in run_from_argv
self.execute(*args, **cmd_options)
File "C:\Users\1130618379\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\management\base.py", line 332, in execute
self.check()
File "C:\Users\1130618379\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\management\base.py", line 364, in check
include_deployment_checks=include_deployment_checks,
File "C:\Users\1130618379\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\management\base.py", line 351, in _run_checks
return checks.run_checks(**kwargs)
File "C:\Users\1130618379\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\checks\registry.py", line 73, in run_checks
new_errors = check(app_configs=app_configs)
File "C:\Users\1130618379\AppData\Local\Programs\Python\Python36-32\lib\site-packages\admin_tools\checks.py", line 18, in check_admin_tools_configuration
get_template('admin:admin/base.html')
File "C:\Users\1130618379\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\template\loader.py", line 15, in get_template
return engine.get_template(template_name)
File "C:\Users\1130618379\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\template\backends\django.py", line 34, in get_template
return Template(self.engine.get_template(template_name), self)
File "C:\Users\1130618379\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\template\engine.py", line 144, in get_template
template, origin = self.find_template(template_name)
File "C:\Users\1130618379\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\template\engine.py", line 126, in find_template
template = loader.get_template(name, skip=skip)
File "C:\Users\1130618379\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\template\loaders\cached.py", line 55, in get_template
template = super().get_template(template_name, skip)
File "C:\Users\1130618379\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\template\loaders\base.py", line 24, in get_template
contents = self.get_contents(origin)
File "C:\Users\1130618379\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\template\loaders\cached.py", line 24, in get_contents
return origin.loader.get_contents(origin)
File "C:\Users\1130618379\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\template\loaders\filesystem.py", line 23, in get_contents
with open(origin.name, encoding=self.engine.file_charset) as fp:
OSError: [Errno 22] Invalid argument: 'C:\Users\1130618379\Documents\django-admin-tools-stats-develop\demoproject\demoproject\templates\admin:admin\base.html'

Anybody an idea?

Possible small mistake in readme.

I had to change this line:

if request.POST.get('select_box_' + i.graph_key):

to:

if context['request'].POST.get('select_box_' + i.graph_key):

Django1.6. Latest git checkout of django-admin-tools and this app.

Update PyPI package

Please update PyPI package with version that is compatible with Django 2.0.

Mistake in app_label_renamer.py?

Now, at the end of wrap method:
return f(model, admin_class, **option)

There should be:
return f(model_or_iterable, admin_class, **option)

am I right?

where is dashboard.py?

The documentation says to add few code snippets to dashboard.py file. But not sure where that file exists.

Please improve the documentation whether that file has to be created or it exists somewhere?

Not sure which version of django/admin-tools it can work with

Found a error in browser console: TypeError: Object [object Object] has no method 'live'
Maybe .live() in jquery has deprecated in the current version in the dashboard?

And I also found that the admin_tools_stats/modules/chart.html seems not rendered, so nvd3 js files didn't loaded by default.

Any tips would be appreciate.

Issue at admin's page

ImportError at /admin/
cannot import name 'smart_unicode'
Request Method: GET
Request URL: http://127.0.0.1:8000/admin/
Django Version: 1.10.4
Exception Type: ImportError
Exception Value:
cannot import name 'smart_unicode'
Exception Location: /myvenv/lib/python3.5/site-packages/cache_utils/utils.py in , line 2
Python Executable: /myvenv/bin/python
Python Version: 3.5.2
Python Path:
['/Users/Miro/Desktop/DjangoProjektApp',
'/Library/Frameworks/Python.framework/Versions/3.5/lib/python35.zip',
'/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5',
'/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/plat-darwin',
'/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/lib-dynload',
'/Users/Miro/Desktop/DjangoProjektApp/myvenv/lib/python3.5/site-packages']
Server time: Mon, 2 Jan 2017 23:26:32 +0000
Error during template rendering

In template /myvenv/lib/python3.5/site-packages/admin_tools/dashboard/templates/admin/index.html, error at line 5
cannot import name 'smart_unicode'
1 {% extends "admin:admin/index.html" %}
2 {% load admin_tools_dashboard_tags %}
3 {% block extrastyle %}
4 {{ block.super }}
5 {% block dashboard_css %}{% admin_tools_render_dashboard_css %}{% endblock %}
6 {% endblock %}
7 {% block coltype %}{% endblock %}
8 {% block bodyclass %}dashboard{% endblock %}
9 {% block content_title %}{% endblock %}
10 {% block content %}
11 {% admin_tools_render_dashboard %}
12 {% endblock %}
13 {% block sidebar %}{% endblock %}

When I changed smart_unicode to smart_text I get following error:

File "/myvenv/lib/python3.5/site-packages/cache_utils/utils.py", line 29, in _func_type
argnames = func.func_code.co_varnames[:func.func_code.co_argcount]
AttributeError: 'function' object has no attribute 'func_code'

Can anyone help me to fix this ?

How does the d3 .js and css get loaded?

Nothing in the instructions mentions it so I was assuming it happened by magic.

However there's nothing there when I view source or look for network requests. Digging in the django-nvd3 code reveals some docstrings that mention a template tag to load all the media. Should this be in my admin templates?

Python 3 compatibility

When running on Python 3.5, I got follwing error:

  File "/home/petr/soubory/programovani/Auto-mat/aklub/aklub/env/lib/python3.5/site-packages/admin_tools_stats/modules.py", line 22, in <module>
    from django.utils.encoding import force_unicode
ImportError: cannot import name 'force_unicode'

For Django 3, there is no python_2_unicode_compatible in django.utils and so it fails

Traceback (most recent call last):
File "X:\Lukas\MasterDrive\MasterdriveBackend\masterdrivebackend\manage.py", line 21, in
main()
File "X:\Lukas\MasterDrive\MasterdriveBackend\masterdrivebackend\manage.py", line 17, in main
execute_from_command_line(sys.argv)
File "C:\Miniconda3\lib\site-packages\django\core\management_init_.py", line 419, in execute_from_command_line
utility.execute()
File "C:\Miniconda3\lib\site-packages\django\core\management_init_.py", line 395, in execute
django.setup()
File "C:\Miniconda3\lib\site-packages\django_init_.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "C:\Miniconda3\lib\site-packages\django\apps\registry.py", line 114, in populate
app_config.import_models()
File "C:\Miniconda3\lib\site-packages\django\apps\config.py", line 301, in import_models
self.models_module = import_module(models_module_name)
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1030, in _gcd_import
File "", line 1007, in _find_and_load
File "", line 986, in _find_and_load_unlocked
File "", line 680, in _load_unlocked
File "", line 850, in exec_module
File "", line 228, in _call_with_frames_removed
File "C:\Miniconda3\lib\site-packages\admin_tools_stats\models.py", line 18, in
from django.utils.encoding import python_2_unicode_compatible

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.