报错信息如下:
# jinja2.exceptions.TemplateNotFound
jinja2.exceptions.TemplateNotFound: blog/index.html
## Traceback *(most recent call last)*
* #### File "C:\Users\Administrator\.virtualenvs\bluelog-CREqRzsw\lib\site-packages\flask\app.py", line *2464* , in `__call__`
return self.wsgi_app(environ, start_response)
* #### File "C:\Users\Administrator\.virtualenvs\bluelog-CREqRzsw\lib\site-packages\flask\app.py", line *2450* , in `wsgi_app`
response = self.handle_exception(e)
* #### File "C:\Users\Administrator\.virtualenvs\bluelog-CREqRzsw\lib\site-packages\flask\app.py", line *1867* , in `handle_exception`
reraise(exc_type, exc_value, tb)
* #### File "C:\Users\Administrator\.virtualenvs\bluelog-CREqRzsw\lib\site-packages\flask\_compat.py", line *39* , in `reraise`
raise value
* #### File "C:\Users\Administrator\.virtualenvs\bluelog-CREqRzsw\lib\site-packages\flask\app.py", line *2447* , in `wsgi_app`
response = self.full_dispatch_request()
* #### File "C:\Users\Administrator\.virtualenvs\bluelog-CREqRzsw\lib\site-packages\flask\app.py", line *1952* , in `full_dispatch_request`
rv = self.handle_user_exception(e)
* #### File "C:\Users\Administrator\.virtualenvs\bluelog-CREqRzsw\lib\site-packages\flask\app.py", line *1821* , in `handle_user_exception`
reraise(exc_type, exc_value, tb)
* #### File "C:\Users\Administrator\.virtualenvs\bluelog-CREqRzsw\lib\site-packages\flask\_compat.py", line *39* , in `reraise`
raise value
* #### File "C:\Users\Administrator\.virtualenvs\bluelog-CREqRzsw\lib\site-packages\flask\app.py", line *1950* , in `full_dispatch_request`
rv = self.dispatch_request()
* #### File "C:\Users\Administrator\.virtualenvs\bluelog-CREqRzsw\lib\site-packages\flask\app.py", line *1936* , in `dispatch_request`
return self.view_functions[rule.endpoint](**req.view_args)
* #### File "E:\Trainning\bluelog\bluelog\blueprints\blog.py", line *8* , in `index`
return render_template('blog/index.html')
* #### File "C:\Users\Administrator\.virtualenvs\bluelog-CREqRzsw\lib\site-packages\flask\templating.py", line *138* , in `render_template`
ctx.app.jinja_env.get_or_select_template(template_name_or_list),
* #### File "C:\Users\Administrator\.virtualenvs\bluelog-CREqRzsw\lib\site-packages\jinja2\environment.py", line *930* , in `get_or_select_template`
return self.get_template(template_name_or_list, parent, globals)
* #### File "C:\Users\Administrator\.virtualenvs\bluelog-CREqRzsw\lib\site-packages\jinja2\environment.py", line *883* , in `get_template`
return self._load_template(name, self.make_globals(globals))
* #### File "C:\Users\Administrator\.virtualenvs\bluelog-CREqRzsw\lib\site-packages\jinja2\environment.py", line *857* , in `_load_template`
template = self.loader.load(self, name, globals)
* #### File "C:\Users\Administrator\.virtualenvs\bluelog-CREqRzsw\lib\site-packages\jinja2\loaders.py", line *115* , in `load`
source, filename, uptodate = self.get_source(environment, name)
* #### File "C:\Users\Administrator\.virtualenvs\bluelog-CREqRzsw\lib\site-packages\flask\templating.py", line *60* , in `get_source`
return self._get_source_fast(environment, template)
* #### File "C:\Users\Administrator\.virtualenvs\bluelog-CREqRzsw\lib\site-packages\flask\templating.py", line *89* , in `_get_source_fast`
raise TemplateNotFound(template)
> jinja2.exceptions.TemplateNotFound: blog/index.html
描述:不仅是blog/index.html找不到,错误处理400,404,500也都出现找不到现象