已配置该命令,报错如下:
[2019-03-30 12:21:48,554] INFO in debughelpers: Locating template "register.html":
1: trying loader of application "app"
class: jinja2.loaders.FileSystemLoader
encoding: 'utf-8'
followlinks: False
searchpath:
- /root/blog/app/templates
-> found ('/root/blog/app/templates/register.html')
2: trying loader of blueprint "bootstrap" (flask_bootstrap)
class: jinja2.loaders.FileSystemLoader
encoding: 'utf-8'
followlinks: False
searchpath:
- /root/blog/venv/lib/python3.5/site-packages/flask_bootstrap/templates
-> no match
[2019-03-30 12:21:48,560] INFO in debughelpers: Locating template "base.html ":
1: trying loader of application "app"
class: jinja2.loaders.FileSystemLoader
encoding: 'utf-8'
followlinks: False
searchpath:
- /root/blog/app/templates
-> no match
2: trying loader of blueprint "bootstrap" (flask_bootstrap)
class: jinja2.loaders.FileSystemLoader
encoding: 'utf-8'
followlinks: False
searchpath:
- /root/blog/venv/lib/python3.5/site-packages/flask_bootstrap/templates
-> no match
Error: the template could not be found.
The template was looked up from an endpoint that belongs to the blueprint "auth".
Maybe you did not place a template in the right folder?
See http://flask.pocoo.org/docs/blueprints/#templates
120.229.144.232 - - [30/Mar/2019 12:21:48] "GET /auth/register HTTP/1.1" 500 -
Traceback (most recent call last):
File "/root/blog/venv/lib/python3.5/site-packages/flask/app.py", line 2309, in __call__
return self.wsgi_app(environ, start_response)
File "/root/blog/venv/lib/python3.5/site-packages/flask/app.py", line 2295, in wsgi_app
response = self.handle_exception(e)
File "/root/blog/venv/lib/python3.5/site-packages/flask/app.py", line 1741, in handle_exception
reraise(exc_type, exc_value, tb)
File "/root/blog/venv/lib/python3.5/site-packages/flask/_compat.py", line 35, in reraise
raise value
File "/root/blog/venv/lib/python3.5/site-packages/flask/app.py", line 2292, in wsgi_app
response = self.full_dispatch_request()
File "/root/blog/venv/lib/python3.5/site-packages/flask/app.py", line 1815, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/root/blog/venv/lib/python3.5/site-packages/flask/app.py", line 1718, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/root/blog/venv/lib/python3.5/site-packages/flask/_compat.py", line 35, in reraise
raise value
File "/root/blog/venv/lib/python3.5/site-packages/flask/app.py", line 1813, in full_dispatch_request
rv = self.dispatch_request()
File "/root/blog/venv/lib/python3.5/site-packages/flask/app.py", line 1799, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/root/blog/app/views/auth.py", line 57, in register
return render_template('register.html', form=form)
File "/root/blog/venv/lib/python3.5/site-packages/flask/templating.py", line 135, in render_template
context, ctx.app)
File "/root/blog/venv/lib/python3.5/site-packages/flask/templating.py", line 117, in _render
rv = template.render(context)
File "/root/blog/venv/lib/python3.5/site-packages/jinja2/environment.py", line 1008, in render
return self.environment.handle_exception(exc_info, True)
File "/root/blog/venv/lib/python3.5/site-packages/jinja2/environment.py", line 780, in handle_exception
reraise(exc_type, exc_value, tb)
File "/root/blog/venv/lib/python3.5/site-packages/jinja2/_compat.py", line 37, in reraise
raise value.with_traceback(tb)
File "/root/blog/app/templates/register.html", line 1, in top-level template code
{% extends 'base.html '%}
File "/root/blog/venv/lib/python3.5/site-packages/flask/templating.py", line 57, in get_source
return self._get_source_explained(environment, template)
File "/root/blog/venv/lib/python3.5/site-packages/flask/templating.py", line 78, in _get_source_explained
raise TemplateNotFound(template)
jinja2.exceptions.TemplateNotFound: base.html