无法覆盖Django Admin模板文件

时间:2016-09-02 13:34:26

标签: django django-templates django-admin

我已经看到这个问题得到了解答,但我无法在我的网站上工作。我已经使用Django 1.8安装了一个网站,因为我想使用django-admin-bootstrapped插件。我也在使用template provided by Heroku

我想要做的是至少覆盖base_site.html以更改网站标题和网页标题。但是,我已经为此文件尝试了几个位置,包括以下内容:

TEMPLATES = [
{
    'BACKEND': 'django.template.backends.django.DjangoTemplates',
    'DIRS': [os.path.join(BASE_DIR, 'templates')],
    'APP_DIRS': True,
    'OPTIONS': {
        'context_processors': [
            'django.template.context_processors.debug',
            'django.template.context_processors.request',
            'django.contrib.auth.context_processors.auth',
            'django.contrib.messages.context_processors.messages',
        ],
        'debug': DEBUG,
    },
},
]

这些都不起作用。我的settings.py

中有以下内容
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Body>
      <ns1:Data xmlns:ns1="http://vv.com/namespace">
         <Addr>Address 1</Addr1>
         <Locality>San Francisco</Locality>
         <Country>Japan</Country>
         <CountryCode>JP</CountryCode>
      </ns1:Data>
   </soapenv:Body>
</soapenv:Envelope>

我只是想知道我是在做一些根本错误的事情,还是我还没有找到模板文件夹的魔术位置(或文件夹的顺序等)。

在相关的说明中,无论如何都要调试模板的拉出位置,还是根据它们应该来自何处进行猜测?

1 个答案:

答案 0 :(得分:0)

  

并非每个应用或每个模型都会覆盖contrib / admin / templates / admin中的每个模板。以下内容可以:

     
      
  • app_index.html
  •   
  • change_form.html
  •   
  • change_list.html
  •   
  • delete_confirmation.html
  •   
  • object_history.html
  •   

enter link description here

覆盖change_list.html以更改网站标题和网页标题

相关问题