Search code examples
djangoherokuweb-applications

TemplateDoesNotExist on Heroku but works on local server


I am new to django and Heroku. I followed a tutorial on creating a webpage with multiple pages extending on a base page and hosted it on Heroku, it worked.

I decided to add a new page with an image (with URL source), and followed the same steps as I did in the tutorial. However, the new page, and only the new page results in "TemplateDoesNotExist".

I have proofread multiple times and tried it without the image but it just will not work on Heroku. It does however work on the local web server.

Thanks for the help!


Solution

  • Are you sure that template is there? How did you upload your code to Heroku? Check if there is a hello.html on server. If you used Git, check if template is actually tracked by git.

    Also, you can move your templates from that app to <project_name>/<app_name>/templates Templates will stay within their respective app. Django will find them automatically.