Skip to main content

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. Installation:
pip install django-admin-index-modules
  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:
    from django_admin_index_modules.admin import AdminModuleView

    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:
    from django.contrib import admin

    admin.site.register_module(VisitorsAdminModuleView, position="middle_top")
    1. using @register_module(position="middle_top") decorator:
    from django_admin_index_modules.admin import register_module

    @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. create template file under "admin/modules/" than the name of the template file assigned to template_name propriety ex: "visitors.html"

  2. Visit http://127.0.0.1:8000/admin/ to see your widget module.

Metadata

Release files for django-admin-index-modules 1.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-admin-index-modules 1.0.3
File Size Uploaded
django_admin_index_modules-1.0.3.tar.gz 10.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-admin-index-modules 1.0.3
File Interpreter ABI Platform
django_admin_index_modules-1.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 32.4 kB

Release files / django_admin_index_modules-1.0.3.tar.gz

Download URL django_admin_index_modules-1.0.3.tar.gz
Size 10.4 kB
Tags Source
SHA-256 checksum
How to use checksums
bb1558cf9a6ec8fe9addfd5a55fb511fe13e76bc9c508dcf7a56db8efc6a7c13
BLAKE2b-256 checksum
How to use checksums
fe694c7a2187689c6cb93317b7e4716486465fbe5f049cc4d2593341859fdc85
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.5

Release files / django_admin_index_modules-1.0.3-py3-none-any.whl

Download URL django_admin_index_modules-1.0.3-py3-none-any.whl
Size 21.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
26d191771ef56b2f7aae1527323f0f7dfc5b10ffd31d56edad54e7fbd6625245
BLAKE2b-256 checksum
How to use checksums
6c57d1425f3178bcc2fb817cd4b9331a3baff7471eda1516d77a03ed2cfd4539
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.5

Release history Release notifications | RSS feed

This release

1.0.3 This release

2 release files

1.0.2

2 release files

1.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page