Wednesday, 4 December 2019

Flask Error Template not found

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 


--> hello.py
-->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_app

    response = 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

Feature Selection in AI

In artifical intelegance/machine learning, everything start and end with data and in current world everyday by using facebook, insta we all ...