I am following this tutorial
.
Similar to Flask raises TemplateNotFound error even though template file exists from six years ago, I cannot render the page because Flask raises "jinja2.exceptions.TemplateNotFound: hello_there.html". Not only is hello_there.html
in the templates
directory, I believe templates
is located in the right place because it's in the same directory as the Python module (outside the virtual environment):
hello_flask/
env/
app.py
templates/
hello_there.html
From that same post, I tried setting the EXPLAIN_TEMPLATE_LOADING
option to True
, but I didn't get a report logged to the Flask app.logger
if I configured it correctly in launch.json
:
"env": {
"FLASK_APP": "app.py",
"FLASK_ENV": "development",
"EXPLAIN_TEMPLATE_LOADING": "True",
"FLASK_DEBUG": "0"
}
Okay, finally, when I run the program through the Flask debug configuration, it raises FileNotFoundError
, "The system cannot find the path specified". Would this affect the template error? I have run a basic python Flask file fine without templates even with this error. I've tried to fix it by adding the location of the interpret to the PATH
variable which I copied from a sys.executable
print statement, but the interpreter still raises it.