Django Admin - change header 'Django administration' text

后端 未结 18 2342
眼角桃花
眼角桃花 2020-11-28 01:14

How does one change the \'Django administration\' text in the django admin header?

It doesn\'t seem to be covered in the \"Customizing the admin\" documentation.

18条回答
  •  醉酒成梦
    2020-11-28 01:47

    In urls.py you can override the 3 most important variables:

    from django.contrib import admin
    
    admin.site.site_header = 'My project'                    # default: "Django Administration"
    admin.site.index_title = 'Features area'                 # default: "Site administration"
    admin.site.site_title = 'HTML title from adminsitration' # default: "Django site admin"
    

    Reference: Django documentation on these attributes.

提交回复
热议问题