Django Admin - change header 'Django administration' text

后端 未结 18 2305
眼角桃花
眼角桃花 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:33

    There is an easy way to set admin site header - assign it to current admin instance in urls.py like this

    admin.site.site_header = 'My admin'
    

    Or one can implement some header-building magic in separate method

    admin.site.site_header = get_admin_header()
    

    Thus, in simple cases there's no need to subclass AdminSite

提交回复
热议问题