mac*_*guy 3 django overriding admin django-templates
像这个问题,我的管理员覆盖不在我的生产环境中工作,但它们在我的开发环境中(相同的django版本).我尝试在settings.py中重新排序INSTALLED_APPS元组而没有任何变化(是上面链接的问题的答案).这是我如何构建我的项目:
/WebDJ/ # project dir
+devices # unrelated app, but it uses templates (see below)
+sales
__init__.py
admin.py
models.py # has Customer and Transaction model classes
+templates
+admin
+sales
+Customer
change_form.html
+Transaction
change_form.html
+devices # lots of templates under here that work fine
404.html
500.html
Run Code Online (Sandbox Code Playgroud)
也:
TEMPLATE_DIRS = ('/WebDJ/templates',)
Run Code Online (Sandbox Code Playgroud)
在settings.py中设置.设备应用程序中的模板很好.什么没有加载是管理目录中的覆盖 - 所以Customer和Transaction的更改表单添加了一些额外的东西(覆盖"after_field_sets"块).
同样,它适用于我的开发环境(使用PyCharm),但不适用于我的生产环境.有任何想法吗?我真的很难过这个.
答:在我的生产机器上,显然它不喜欢"客户"和"交易",尽管它是模型的确切名称 - 它需要"客户"和"交易".
归档时间: |
|
查看次数: |
1172 次 |
最近记录: |