也许这是我缺少的东西,但由于某种原因,django 没有在正确的位置寻找模板。我已将联系人/模板文件夹包含在 TEMPLATE_DIRS 中,并将应用程序包含在 INSTALLED_APPS 中,但是当我访问 URL 时,它仍然会检查我在设置文件中列出的每个其他目录中的 contact.html,接受它所在的那个。我收到 TemplateDoesNotExist 错误。是否有我可以用来诊断问题的 python shell 命令?
TEMPLATE_DIRS = [
os.path.join(PACKAGE_ROOT, "templates"),
'/mysite/contact/templates', #does not search this one
'/mysite/liquor/templates', #searches this one
'/mysite/store/templates', #searches this one
'/mysite/order/templates', #searches this one
]
INSTALLED_APPS = [
"django.contrib.admin",
"django.contrib.auth",
"django.contrib.contenttypes",
"django.contrib.sessions",
"django.contrib.sites",
"django.contrib.messages",
"django.contrib.staticfiles",
# theme
"pinax_theme_bootstrap",
"django_forms_bootstrap",
# external
"account",
"metron",
"eventlog",
"paypal.standard.ipn",
"djangojs",
"django_tables2",
"django_filters",
# project
"contact",
"mysite",
"liquor",
"store",
"order",
]