loading376 2019-10-17 09:35 采纳率: 0%
浏览 2280
已结题

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

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

  • 写回答

3条回答

  • 妖孽哪里走㍿  2021-05-15 22:35
    关注

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

    评论

报告相同问题?

悬赏问题

  • ¥50 永磁型步进电机PID算法
  • ¥15 sqlite 附加(attach database)加密数据库时,返回26是什么原因呢?
  • ¥88 找成都本地经验丰富懂小程序开发的技术大咖
  • ¥15 如何处理复杂数据表格的除法运算
  • ¥15 如何用stc8h1k08的片子做485数据透传的功能?(关键词-串口)
  • ¥15 有兄弟姐妹会用word插图功能制作类似citespace的图片吗?
  • ¥200 uniapp长期运行卡死问题解决
  • ¥15 latex怎么处理论文引理引用参考文献
  • ¥15 请教:如何用postman调用本地虚拟机区块链接上的合约?
  • ¥15 为什么使用javacv转封装rtsp为rtmp时出现如下问题:[h264 @ 000000004faf7500]no frame?