Published on May 21, 2023
Go homeHow to customise AdminSite attributes
The django AdminSite provides the following attributes. You may wish to provide a custom value for some of these like the site_header
and site_title
.
To provide custom values for the admin site header and title, add the following snippet your project's urls.py
where the admin site resource is registered.
from django.urls import path
from django.contrib import admin
from django.contrib.auth import models as auth_models
admin.site.site_title = "My Site"
admin.site.site_header = "My Site Header"
The site_title
is placed in the \<title\>
after the |
. So the above will yield \<title>Site administration | My Site\<\\title\>
.