I am trying to render the file home.html
. The file exists in my project, but I keep getting jinja2.exceptions.TemplateNotFound: home.html
when I t
(Please note that the above accepted Answer provided for file/project structure is absolutely correct.)
Also..
In addition to properly setting up the project file structure, we have to tell flask to look in the appropriate level of the directory hierarchy.
for example..
app = Flask(__name__, template_folder='../templates')
app = Flask(__name__, template_folder='../templates', static_folder='../static')
Starting with ../
moves one directory backwards and starts there.
Starting with ../../
moves two directories backwards and starts there (and so on...).
Hope this helps