In django admin, we can define custom templates per app. In this case, I'm customising the app_index.html
template for my application.
I'd like to add a few graphs and other to that page. Now that I've overridden the template, how can I override the corresponding view method?
I thought about making a custom AdminSite
and override the app_index()
(see https://github.com/django/django/blob/master/django/contrib/admin/sites.py#L511) method, but I have more than one application in my django installation, all of which will have a custom app_index.html
.
What's the best way to add context to the app_index.html
template?
Don't know if this is the best way, but it can be done with template tags. Here is how I did it:
.