[Django]-Overriding Django Admin's main page? – Django

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.

Screenshot of customised admin page

3👍

Leave a comment