<bdo id='HRES9'></bdo><ul id='HRES9'></ul>

    1. <small id='HRES9'></small><noframes id='HRES9'>

      <legend id='HRES9'><style id='HRES9'><dir id='HRES9'><q id='HRES9'></q></dir></style></legend>
      <i id='HRES9'><tr id='HRES9'><dt id='HRES9'><q id='HRES9'><span id='HRES9'><b id='HRES9'><form id='HRES9'><ins id='HRES9'></ins><ul id='HRES9'></ul><sub id='HRES9'></sub></form><legend id='HRES9'></legend><bdo id='HRES9'><pre id='HRES9'><center id='HRES9'></center></pre></bdo></b><th id='HRES9'></th></span></q></dt></tr></i><div id='HRES9'><tfoot id='HRES9'></tfoot><dl id='HRES9'><fieldset id='HRES9'></fieldset></dl></div>
    2. <tfoot id='HRES9'></tfoot>

      1. Django Admin - 更改标题“Django 管理"文本

        Django Admin - change header #39;Django administration#39; text(Django Admin - 更改标题“Django 管理文本)
        <tfoot id='tSqXg'></tfoot>
          <tbody id='tSqXg'></tbody>

        <small id='tSqXg'></small><noframes id='tSqXg'>

            <legend id='tSqXg'><style id='tSqXg'><dir id='tSqXg'><q id='tSqXg'></q></dir></style></legend>
                • <bdo id='tSqXg'></bdo><ul id='tSqXg'></ul>

                • <i id='tSqXg'><tr id='tSqXg'><dt id='tSqXg'><q id='tSqXg'><span id='tSqXg'><b id='tSqXg'><form id='tSqXg'><ins id='tSqXg'></ins><ul id='tSqXg'></ul><sub id='tSqXg'></sub></form><legend id='tSqXg'></legend><bdo id='tSqXg'><pre id='tSqXg'><center id='tSqXg'></center></pre></bdo></b><th id='tSqXg'></th></span></q></dt></tr></i><div id='tSqXg'><tfoot id='tSqXg'></tfoot><dl id='tSqXg'><fieldset id='tSqXg'></fieldset></dl></div>
                  本文介绍了Django Admin - 更改标题“Django 管理"文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  如何更改 django 管理标头中的Django 管理"文本?

                  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.

                  推荐答案

                  更新:如果您使用的是 Django 1.7+,请参阅 在下面回答.

                  Update: If you are using Django 1.7+, see the answer below.

                  2011 年的原始答案:您需要创建自己的管理 base_site.html 模板来执行此操作.最简单的方法是创建文件:

                  Original answer from 2011: You need to create your own admin base_site.html template to do this. The easiest way is to create the file:

                  /<projectdir>/templates/admin/base_site.html
                  

                  这应该是 原始 base_site.html,除了放入您的自定义标题:

                  This should be a copy of the original base_site.html, except putting in your custom title:

                  {% block branding %}
                  <h1 id="site-name">{% trans 'my cool admin console' %}</h1>
                  {% endblock %}
                  

                  为此,您需要为您的项目设置正确的设置,即在 settings.py 中:

                  For this to work, you need to have the correct settings for your project, namely in settings.py:

                  • 确保将 /projectdir/templates/ 添加到 TEMPLATE_DIRS.
                  • 确保将 django.template.loaders.filesystem.Loader 添加到 TEMPLATE_LOADERS.
                  • Make sure /projectdir/templates/ is added into TEMPLATE_DIRS.
                  • Make sure django.template.loaders.filesystem.Loader is added into TEMPLATE_LOADERS.

                  有关 settings.py 的更多信息,请参阅文档.

                  See docs for more information on settings.py.

                  这篇关于Django Admin - 更改标题“Django 管理"文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  What happens when you compare 2 pandas Series(当你比较 2 个 pandas 系列时会发生什么)
                  Quickly find differences between two large text files(快速查找两个大文本文件之间的差异)
                  Python - Compare 2 files and output differences(Python - 比较 2 个文件和输出差异)
                  Why do comparisions between very large float values fail in python?(为什么在 python 中非常大的浮点值之间的比较会失败?)
                  Dictionary merge by updating but not overwriting if value exists(字典通过更新合并,但如果值存在则不覆盖)
                  Find entries of one text file in another file in python(在python中的另一个文件中查找一个文本文件的条目)
                        <tbody id='B6bsa'></tbody>

                      <legend id='B6bsa'><style id='B6bsa'><dir id='B6bsa'><q id='B6bsa'></q></dir></style></legend>
                        <tfoot id='B6bsa'></tfoot>
                      1. <i id='B6bsa'><tr id='B6bsa'><dt id='B6bsa'><q id='B6bsa'><span id='B6bsa'><b id='B6bsa'><form id='B6bsa'><ins id='B6bsa'></ins><ul id='B6bsa'></ul><sub id='B6bsa'></sub></form><legend id='B6bsa'></legend><bdo id='B6bsa'><pre id='B6bsa'><center id='B6bsa'></center></pre></bdo></b><th id='B6bsa'></th></span></q></dt></tr></i><div id='B6bsa'><tfoot id='B6bsa'></tfoot><dl id='B6bsa'><fieldset id='B6bsa'></fieldset></dl></div>
                      2. <small id='B6bsa'></small><noframes id='B6bsa'>

                        • <bdo id='B6bsa'></bdo><ul id='B6bsa'></ul>