Skip to main content

Django admin index modules is a Django app that gives you the ability to add widgets modules to the django admin dashboard (admin index)

Project description

Django admin index modules

Django admin index modules is a Django app that gives you the ability to add widgets modules to the django admin dashboard (admin index).

Quick start

  1. comment "django.contrib.admin" and add "django_admin_index_modules.apps.CustomAdminConfig" to your INSTALLED_APPS setting like this:
    INSTALLED_APPS = [
        ...
        #'django.contrib.admin',
        'django_admin_index_modules.apps.CustomAdminConfig',
        ...

        'django.contrib.staticfiles',
        ...

        'django_admin_index_modules.apps.ModulesDashboardsConfig',
        ...
    ]
  1. In admin.py file of any other app create ypur widget module like this:
    class VisitorsAdminModuleView(AdminModuleView):

        template_name = 'visitors.html'
        json_method_names = ['post']
        http_method_names = ['get','post']
        permissions = ['is_superuser']
        css = []
        js = []

        def get(self, request, **kwargs):
            context = {
                'stats': "visitors"
            }
            return context
  1. register your widget module using one of those methods:

    1. using register_module(AdminModuleView, position="middle_top") methods:
    site.register_module(VisitorsAdminModuleView, position="middle_top")
    1. using @register_module(position="middle_top") decorator:
    @register_module(position="middle_top")
    class VisitorsAdminModuleView(AdminModuleView):
        ...
    1. position keyword can take one of those values: top, middle_top, middle_bottom and bottom
  1. Visit http://127.0.0.1:8000/admin/ to see your widget module.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_admin_index_modules-1.0.1.tar.gz (8.8 kB view hashes)

Uploaded Source

Built Distribution

django_admin_index_modules-1.0.1-py3-none-any.whl (20.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page