I’m getting a TemplateDoesNotExist error on Heroku when it looks for my html files. The files all sync up on the development server. The TEMPLATE_DIRS setting is set to:
TEMPLATE_DIRS = ['/Users/jonathanschen/Python/projects/skeleton/myportfolio/templates',]
But when trying to load the page the herokuapp page I get the following error:
I think there’s something very basic I’m missing here.
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)
You’ll need to update your TEMPLATE_DIRS setting to point to something Heroku can find – the path that you have it set to right now will work locally, but Heroku has no idea where
/Users/jonathanschen/is (because it doesn’t have that folder). You might want to try making your TEMPLATE_DIRS setting use a relative path:(from http://www.djangofoo.com/35/template_dirs-project-folder)
In Django 1.8+, change the
DIRSoption inTEMPLATESinstead: