After reading through this question, I have some insight as to why when trying to launch my app after deploying to Heroku, I get the following error: raise TemplateNotFound(template), jinja2.exceptions.TemplateNotFound: index.html
.
They are saying that the templates
should be at the project directory root as shown here. Is there anyway I can modify where Heroku is trying to look for the templates
directory? I modified my project structure since my app was growing in size and starting to look a bit unorganized.
Here is a look at my current project structure:
Project
│
├── App
│ ├── DbMs
│ │ ├── db_actions.py
│ │ └── user_operations.py
│ ├── UI
│ │ ├── static
│ │ │ ├── css
│ │ │ │ └── main.css
│ │ │ ├── fonts
│ │ │ │ └── Gotham_Medium_Regular.json
│ │ │ ├── images
│ │ │ │ ├── favicons
│ │ │ │ │ ├── android-chrome-192x192.png
│ │ │ │ │ ├── android-chrome-512x512.png
│ │ │ │ │ ├── apple-touch-icon.png
│ │ │ │ │ ├── favicon-16x16.png
│ │ │ │ │ ├── favicon-32x32.png
│ │ │ │ │ ├── favicon.ico
│ │ │ │ │ └── site.webmanifest
│ │ │ │ ├── header.jpeg
│ │ │ │ ├── logo.png
│ │ │ │ └── radar-chart.png
│ │ │ └── javascript
│ │ │ ├── FontLoader.js
│ │ │ ├── TextGeometry.js
│ │ │ ├── create.js
│ │ │ ├── exploreMusic.js
│ │ │ └── tracks.js
│ │ └── templates
│ │ ├── base.html
│ │ ├── create.html
│ │ ├── index.html
│ │ ├── information.html
│ │ └── tracks.html
│ ├── __init__.py
│ ├── authenticate.py
│ ├── routes.py
│ ├── services.py
│ └── templates
├── Pipfile
├── Procfile
├── README.md
├── Testing
│ ├── __init__.py
│ └── testing.py
├── __pycache__
│ ├── authenticate.cpython-39.pyc
│ ├── config.cpython-39.pyc
│ ├── main.cpython-39.pyc
│ ├── services.cpython-39.pyc
│ └── user_operations.cpython-39.pyc
├── config.py
├── package-lock.json
├── package.json
├── requirements.txt
├── run.py
└── setup.py
For more context, I have everything running perfectly fine locally, I only see this error after deployment. Thanks to anyone who can provide insight.
EDIT: I tried moving the templates
folder into the App
directory as well as the project root and changing the following line in __init__.py
both times:
template_dir = os.path.abspath('../Project/templates/')
After deploying each time, I changed the location of templates
, still see the same error from Heroku: raise TemplateNotFound(template) jinja2.exceptions.TemplateNotFound: index.html