app.py文件
from flask import Flask
from flask_bootstrap import Bootstrap
app = Flask(__name__)
bootstrap = Bootstrap(app)
@app.route('/')
def hello_world():
return 'Hello World!'
@app.route('/user/<name>')
def user(name):
return render_template('user.html', name=name)
if __name__ == '__main__':
app.run()
在user.html文件中有高亮提示,并且有Unresolved template reference提示
Unresolved template reference提示如下图
文件结构如下,templates文件夹与app.py文件同级,所以不是这个问题
程序能正常运行,当访问127.0.0.1:5000/user/时就会出现
Internal Server Error
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.
并且报错:jinja2.exceptions.TemplateNotFound: bootstrap/base.html
我在网上找了很多解决方案都没有用,希望有哪位大侠能帮忙解决