3
HTML 파일을 찾을 때 Heroku에서 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을 당신은 상대 경로를 사용 설정하여 TEMPLATE_DIRS을 시도 할 수도 있습니다 응답 주셔서 감사합니다, 당신이 제안한 상대 경로로 설정을 업데이 트했는데 그것은 여전히 캔트 어떤 이유로 템플릿을 찾을 수 없습니다. – Jonathan
Django는 다음 템플릿을이 순서대로로드하려고 시도했습니다. 로더 사용 django.template.loaders.filesystem.Loader : /app/myportfolio/templates/index.html (파일이 존재하지 않습니다) 로더 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
@ girasquad : 앱을 로컬로 실행할 수 있습니까? – Parker