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
- 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',
...
]
- 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
-
register your widget module using one of those methods:
-
- using register_module(AdminModuleView, position="middle_top") methods:
site.register_module(VisitorsAdminModuleView, position="middle_top")
-
- using @register_module(position="middle_top") decorator:
@register_module(position="middle_top")
class VisitorsAdminModuleView(AdminModuleView):
...
-
- position keyword can take one of those values: top, middle_top, middle_bottom and bottom
-
Visit http://127.0.0.1:8000/admin/ to see your widget module.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for django_admin_index_modules-1.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | cd0222d0b018f0bc0fdd1d08fd1c12231e68727dfa56aa6dbb28528fa413e94c |
|
MD5 | 83d0c006ac86db7c431e93bf7de2a1a8 |
|
BLAKE2b-256 | 779f1f8904b8b5c94b6d537d0c802de260b2216a5c06298b0f9f9b341478c74e |
Close
Hashes for django_admin_index_modules-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dd44f8d49e850ff7035518ed2010b958da736d8c6a7a62466071b19a675a71a9 |
|
MD5 | 6d280102964603226873d13bf6322dbd |
|
BLAKE2b-256 | 733b001db3809b98518ac4d03ccc7c0dc21836290409a868a3c788866f360d58 |