4
You can use template hierarchy like:
index.html
... {% block content %} ... {% block mycontent %}My custom text{% endblock %} ... {% endblock %}
app_index.html
... {% block mycontent %}{% endblock %} ..
3
I have done this by modifying the admin/index.html
template. You may also need to modify admin/base_site.html
(depending on what you want to do, exactly).
These templates are found in the django/contrib/admin/templates/admin
folder in a Django installation.
Update: That’s exactly what I’ve done, see the screenshot fragment below. The section marked in red is the section I added, via HTML in admin/index.html
. However, you don’t say which version of Django you’re using – my example is from a 1.0 installation.
- [Django]-Using Python Dataclass in Django Models
- [Django]-Access Django Test Database
- [Django]-CSRF verification failed after adding a filefield on model
- [Django]-Django multi-tenant
- [Django]-502 Bad Gateway with DigitalOcean (gunicorn/nginx) using Selenium and Django
3
According to http://docs.djangoproject.com/en/dev/ref/contrib/admin/#overriding-vs-replacing-an-admin-template you will want to override admin/app_index.html
Source:stackexchange.com