Django Admin
site customization
web development
tutorial
Django tips

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

Master System Design with Codemia

Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.

Introduction

Django's admin site exposes three text settings that people often want to brand: site_header, site_title, and index_title. The simplest way to change them is to assign new strings on admin.site during admin startup.

This is much easier than overriding templates when all you want is the visible title text. Template overrides are still useful for deeper visual customization, but they are not required for these three labels.

The Quick Solution

In your app's admin.py, set the values directly:

python
1from django.contrib import admin
2
3admin.site.site_header = "Inventory Administration"
4admin.site.site_title = "Inventory Admin"
5admin.site.index_title = "Site management"

That is enough for many projects.

These properties control different places in the UI:

  • 'site_header is the large heading shown at the top of admin pages'
  • 'site_title is the browser tab title text'
  • 'index_title is the title shown on the admin index page body'

Where to Put the Code

The most common place is admin.py, because Django loads it as part of admin registration.

For example:

python
1# myapp/admin.py
2from django.contrib import admin
3from .models import Product
4
5admin.site.site_header = "My Company Admin"
6admin.site.site_title = "My Company Back Office"
7admin.site.index_title = "Administration"
8
9@admin.register(Product)
10class ProductAdmin(admin.ModelAdmin):
11    list_display = ("name", "price")

As long as the module is imported during startup, those settings take effect.

Using a Custom AdminSite

If you want more control or more than one admin site, define a subclass of AdminSite:

python
1from django.contrib.admin import AdminSite
2
3class MyAdminSite(AdminSite):
4    site_header = "Operations Admin"
5    site_title = "Operations Portal"
6    index_title = "Administration"
7
8custom_admin_site = MyAdminSite(name="custom_admin")

Then register models on that custom site instead of the default one.

This is useful when:

  • you want multiple admin interfaces
  • you want custom permission logic
  • you want a clean place for admin-specific behavior beyond title strings

Wiring a Custom Site into URLs

If you use a custom AdminSite, point your URL configuration at it:

python
1from django.urls import path
2from myapp.admin_site import custom_admin_site
3
4urlpatterns = [
5    path("admin/", custom_admin_site.urls),
6]

From that point on, the branded titles come from the custom site instance, not from the default global admin.site object.

When Template Overrides Are Needed

Changing the three title strings does not change logos, CSS, or the overall page layout. If you want to alter the full look and feel, then template overrides are the next step.

For example, you might override admin/base_site.html to add a logo or reorganize the header. But that is a separate task from simply changing site_header, site_title, and index_title.

So the right order is usually:

  1. set the three admin strings directly
  2. only move to template overrides if you need more than text changes

Common Pitfalls

The biggest pitfall is setting these values in a module that Django never imports. If the assignment code does not run during startup, nothing changes in the admin.

Another common issue is confusing the three properties. site_title affects the browser tab title, while site_header affects the visible header in the page itself.

Developers also sometimes override templates unnecessarily for a change that only needs three simple assignments. That adds maintenance cost without any real benefit.

Finally, if you create a custom AdminSite but still use admin.site.urls in urls.py, your new titles will never appear because the project is still serving the default site.

Summary

  • Set admin.site.site_header, admin.site.site_title, and admin.site.index_title for the simplest branding change.
  • Putting those assignments in admin.py is often enough.
  • Use a custom AdminSite when you need multiple admin sites or deeper control.
  • Update urls.py if you switch to a custom site instance.
  • Only override admin templates when you need more than text changes.

Course illustration
Course illustration

All Rights Reserved.