Search code examples
pythondjangoheaderdjango-admintitlebar

How to change site title, site header and index title in Django Admin?


How can I change the site title Django site admin, the site header Django administration and the index title Site administration in Django Admin?

enter image description here


Solution

  • Update: If you are using Django 1.7+, see the answer below.


    Original answer from 2011: You need to create your own admin base_site.html template to do this. The easiest way is to create the file:

    /<projectdir>/templates/admin/base_site.html
    

    This should be a copy of the original base_site.html, except putting in your custom title:

    {% block branding %}
    <h1 id="site-name">{% trans 'my cool admin console' %}</h1>
    {% endblock %}
    

    For this to work, you need to have the correct settings for your project, namely in settings.py:

    • Make sure /projectdir/templates/ is added into TEMPLATE_DIRS.
    • Make sure django.template.loaders.filesystem.Loader is added into TEMPLATE_LOADERS.

    See docs for more information on settings.py.