Flask Error Template not found
While developing one flask project, this was my initial hitting with this framework, I got a number of errors.
My directory structure was
--> hello.py
-->template-->index.html
But i got the following error, I even tried with the directory structure
-->index.html
jinja2.exceptions.TemplateNotFound
jinja2.exceptions.TemplateNotFound: xindex.html
Traceback (most recent call last)
File "C:\Program Files\Python38\lib\site-packages\flask\app.py", line 2463, in
__call__return self.wsgi_app(environ, start_response)
File "C:\Program Files\Python38\lib\site-packages\flask\app.py", line 2449, in
wsgi_appresponse = self.handle_exception(e)
But both no change in the error. After a short study of the framework, it got clear that directory structure should be
--> hello.py
-->templates/index.html
Now things start working prefrectly.
No comments:
Post a Comment