Django >= 2.1: how to make a customized administration, the “clean” way
How to make easily an administration interface for the whole project
On versions of Django < 2.1, it was impossible to overload the administration “properly”.
- Create a file
admin.pyat the root of your project (“at the root”, because it is “global” for the whole project)
- Put that code:
from django.contrib import admin
title_header = 'My project Admin'
site_header = 'My project administration'
Of course, change “MyProject” to the name of your project…
- In the file
apps.pyof your project, hence
my_project/my_app/apps.py, declare the administration like this:
from django.apps import AppConfig
from django.contrib.admin.apps import AdminConfig
name = 'my_app'
default_site = 'admin.MyProjectAdminSite'
And… that’s it!