jinja2.exceptions.TemplateNotFound: bootstrap/base.html的错误wen'ti

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提示
在user.html中的高亮显示
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

我在网上找了很多解决方案都没有用,希望有哪位大侠能帮忙解决

老哥,我也是同样的问题,你的有没有解决啊

https://blog.csdn.net/qq_42142258/article/details/81349198

可以参考这个,jianshu.com/p/7923d6bfe8b4,应该是你的模板没有app.register_blueprint(demo,url_prefix='/demo')