techwithtim / Flask-Web-App-Tutorial

Code for the note storing flask web app made during a YouTube video.
941 stars 1.03k forks source link

jinja2.exceptions.TemplateNotFound: home.html #78

Open Ainsleyem opened 2 years ago

Ainsleyem commented 2 years ago

File "C:\Users\Emens\AppData\Local\Programs\Python\Python310\lib\site-packages\flask\app.py", line 2548, in call return self.wsgi_app(environ, start_response) File "C:\Users\Emens\AppData\Local\Programs\Python\Python310\lib\site-packages\flask\app.py", line 2528, in wsgi_app response = self.handle_exception(e) File "C:\Users\Emens\AppData\Local\Programs\Python\Python310\lib\site-packages\flask\app.py", line 2525, in wsgi_app response = self.full_dispatch_request() File "C:\Users\Emens\AppData\Local\Programs\Python\Python310\lib\site-packages\flask\app.py", line 1822, in full_dispatch_request rv = self.handle_user_exception(e) File "C:\Users\Emens\AppData\Local\Programs\Python\Python310\lib\site-packages\flask\app.py", line 1820, in full_dispatch_request rv = self.dispatch_request() File "C:\Users\Emens\AppData\Local\Programs\Python\Python310\lib\site-packages\flask\app.py", line 1796, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) File "c:\Users\Emens\OneDrive\python website\website\templates\views.py", line 9, in home return render_template("home.html") File "C:\Users\Emens\AppData\Local\Programs\Python\Python310\lib\site-packages\flask\templating.py", line 146, in render_template template = app.jinja_env.get_or_select_template(template_name_or_list) File "C:\Users\Emens\AppData\Local\Programs\Python\Python310\lib\site-packages\jinja2\environment.py", line 1081, in get_or_select_template return self.get_template(template_name_or_list, parent, globals) File "C:\Users\Emens\AppData\Local\Programs\Python\Python310\lib\site-packages\jinja2\environment.py", line 1010, in get_template return self._load_template(name, globals) File "C:\Users\Emens\AppData\Local\Programs\Python\Python310\lib\site-packages\jinja2\environment.py", line 969, in _load_template template = self.loader.load(self, name, self.make_globals(globals)) File "C:\Users\Emens\AppData\Local\Programs\Python\Python310\lib\site-packages\jinja2\loaders.py", line 126, in load source, filename, uptodate = self.get_source(environment, name) File "C:\Users\Emens\AppData\Local\Programs\Python\Python310\lib\site-packages\flask\templating.py", line 62, in get_source return self._get_source_fast(environment, template) File "C:\Users\Emens\AppData\Local\Programs\Python\Python310\lib\site-packages\flask\templating.py", line 98, in _get_source_fast raise TemplateNotFound(template) jinja2.exceptions.TemplateNotFound: home.html.

how do I fix this?

notaryanramani commented 2 years ago

What's the name of your folder in which the home.html file is located?

Ainsleyem commented 2 years ago

What's the name of your folder in which the home.html file is located?

It is located in a "templates" folder

mattmdjaga commented 1 year ago

I had the same error and it happened because my folder was named "template" instead of "templates"