如題
已安裝 pip install flask_bootstrap,路徑.../venv/lib/python2.7/site-packages/flask_bootstrap
應用結構如下
myapp/
config.py
run.py
requirements.txt
myapp/
__init__.py
models.py
admin/
__init__.py
views.py
static/
templates/
admin 定義為藍圖應用,在views.py中定義一個視圖并return render_template('index.html'),index.html 中繼承bootstrap中的base.html,‘{% extends "bootstrap/base.html" %}’ 。在myapp/__init__.py 中 from flask_bootstrap import Bootstrap 了,然后整個運行程序無報錯,但是訪問視圖時報找不到模板bootstrap/base.html。
求解,藍圖中如何參考bootstrap
uj5u.com熱心網友回復:
已解決,請大神忽略uj5u.com熱心網友回復:
怎么參考的啊 我也遇到問題 提示jinja2.exceptions.TemplateNotFoundTemplateNotFound: index.html
我覺得是 沒有實體化 所以沒找到 這個index
uj5u.com熱心網友回復:
應該需初始化bootstrap = Bootstrap(app)
轉載請註明出處,本文鏈接:https://www.uj5u.com/qianduan/79754.html
標籤:應用服務器
上一篇:element表格多列篩選問題
