Django Admin - change header 'Django administration' text

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

    As you can see in the templates, the text is delivered via the localization framework (note the use of the trans template tag). You can make changes to the translation files to override the text without making your own copy of the templates.

    1. mkdir locale

    2. ./manage.py makemessages

    3. Edit locale/en/LC_MESSAGES/django.po, adding these lines:

      msgid "Django site admin"
      msgstr "MySite site admin"
      
      msgid "Django administration"
      msgstr "MySite administration"
      
    4. ./manage.py compilemessages

    See https://docs.djangoproject.com/en/1.3/topics/i18n/localization/#message-files

提交回复
热议问题