3
当Heroku查找我的html文件时,出现TemplateDoesNotExist
错误。这些文件都在开发服务器上同步。该TEMPLATE_DIRS
设置为:Heroku找不到Django模板
TEMPLATE_DIRS = ['/Users/jonathanschen/Python/projects/skeleton/myportfolio/templates',]
但试图加载页面的herokuapp页我收到以下错误时: 我觉得有一些非常基本的,我在这里失踪。
TemplateDoesNotExist at/
index.html
Request Method: GET
Request URL: http://morning-coast-2859.herokuapp.com/
Django Version: 1.4.1
Exception Type: TemplateDoesNotExist
Exception Value:
index.html
Exception Location: /app/.heroku/venv/lib/python2.7/site-packages/django/template/loader.py in find_template, line 138
Template-loader postmortem
Django tried loading these templates, in this order:
Using loader django.template.loaders.filesystem.Loader:
/Users/jonathanschen/Python/projects/skeleton/myportfolio/templates/index.html (File does not exist)
Using loader django.template.loaders.app_directories.Loader:
/app/.heroku/venv/lib/python2.7/site-packages/django/contrib/auth/templates/index.html (File does not exist)
/app/.heroku/venv/lib/python2.7/site-packages/django/contrib/admin/templates/index.html (File does not exist)
哎girasquid感谢您的回应,我尝试更新设置与您建议的相对路径,但它仍然无法找到模板出于某种原因。 – Jonathan 2012-08-01 22:11:32
它看起来在这里:Django尝试加载这些模板,按以下顺序: 使用loader django.template.loaders.filesystem.Loader: /app/myportfolio/templates/index.html(文件不存在) 使用loader django。 template.loaders.app_directories.Loader: /app/.heroku/venv/lib/python2.7/site-packages/django/contrib/auth/templates/index.html(文件不存在) /app/.heroku /venv/lib/python2.7/site-packages/django/contrib/admin/templates/index.html(文件不存在) – Jonathan 2012-08-01 22:12:01
@girasquad:你可以在本地运行应用程序吗? – Parker 2012-08-01 22:14:54