【发布时间】:2014-01-09 12:36:32
【问题描述】:
例如,我的 django 项目中有 2 个应用程序,其中包含具有相同子路径的模板和静态文件:
app1 /
static /
style.css
templates /
index.html
app2 /
static /
style.css
templates /
index.html
然后,我在 settings.py 中添加了这两个应用程序:
INSTALLED_APPS = (
'app1',
'app2',
)
现在我在模板中以某种方式使用“style.css”和“index.html”,例如
{% include 'index.html' %}
所以,问题是:
Django 是否保证当我引用“style.css”或“index.html”时将使用 app2 子目录中的文件?
在这种情况下,有没有其他方法可以指出 Django 首选的文件变体?
【问题讨论】:
标签: django