就像这个问题一样,我的管理界面覆盖在生产环境中无法工作,但在开发环境中可以(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
同时:
TEMPLATE_DIRS = ('/WebDJ/templates',)
is set in settings.py。设备应用程序中的模板很好。没有加载的是管理目录中的覆盖 - 因此,客户和交易的更改表单添加了一些额外的内容(覆盖“after_field_sets”块)。
同样,在我的开发环境中(使用PyCharm),但不在我的生产环境中工作。有什么想法吗?我对这个问题感到非常困惑。