Django Admin - change header 'Django administration' text

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

    admin.py:

    from django.contrib.admin import AdminSite
    
    AdminSite.site_title = ugettext_lazy('My Admin')
    
    AdminSite.site_header = ugettext_lazy('My Administration')
    
    AdminSite.index_title = ugettext_lazy('DATA BASE ADMINISTRATION')
    

提交回复
热议问题