is there a way of customizing my own admin panel , not in terms of styling. What i wish to achieve is a analytics tab , similar to wagalytics . The issue im having with wagalytics is that it is using google analytics , and google analytics is blocked by most adblockers and Mozilla fire fox , making the data really unreliable. As such i wish to utitlize other services like django-analytical to my wagtail administration page with a graph similar to that of wagalytics . However , i have not yet found any resources online that teaches me to override the admin and create my own customized panel (different from the customized tabs here ).
Could someone point me towards the right direction?
To add a page (link) to the Wagtail admin menu, you can use the hook register_admin_menu_item
.
Create a file my-app/wagtail_hooks.py
and this will be run by Wagtail to hook in custom functionality.
rom django.urls import reverse
from wagtail.core import hooks
from wagtail.admin.menu import MenuItem
@hooks.register('register_admin_menu_item')
def register_frank_menu_item():
return MenuItem('Frank', reverse('name-of-analytics-url'), classnames='icon icon-folder-inverse', order=10000)
You will need to set up the view with whatever reporting/graphs yourself, you could look into the source of wagalytics
or simply serve whatever reporting django-analytics
makes available.
If you want the templates your view use to extend the Wagtail admin templates, you can do this using the wagtailadmin/base.html
. e.g. {% extends "wagtailadmin/base.html" %}
. Note: you may need to add 'wagtail.admin',
to your INSTALLED_APPS
.