[Django]-`Django administration` to the custom title in project templates

9๐Ÿ‘

โœ…

No need to copy and change admin template

In project urls.py just put

admin.site.site_header = 'Mysite Admin Panel'
admin.site.site_title = 'Mysite Admin Panel'

Alternatively:

After copying django/contrib/admin/templates/admin/base_site.html put like this

base_site.html

 {% extends "admin/base.html" %}

 {% block title %}Mysite Admin Panel{% endblock %}

 {% block branding %}
     <h1 id="site-name"><a href="{% url 'admin:index' %}">Mysite Admin Panel</a></h1>
 {% endblock %}

 {% block nav-global %}{% endblock %}
๐Ÿ‘คAstik Anand

Leave a comment