I'm inheriting bootstrap/base.html in a Flask application after installing the Bootstrap Flask extension but having the below error:
jinja2.exceptions.TemplateNotFound: bootstrap/base.html
I'm inheriting bootstrap/base.html in a Flask application after installing the Bootstrap Flask extension but having the below error:
jinja2.exceptions.TemplateNotFound: bootstrap/base.html
You need to import Bootstrap in this way below:
from flask_bootstrap import Bootstrap
...
bootstrap = Bootstrap(app)
flask.ext.bootstrap is deprecated
The answer is correct.
You can test settings in the execution file, for example: flaskr/flaskr.py
from flask_bootstrap import Bootstrap
....
app = Flask(__name__)
bootstrap = Bootstrap(app)
db = SQLAlchemy(app)
The problem should have been solved.
Need to import Bootstrap from flask.ext.bootstrap and bootstrap the flask app as below:
from flask.ext.bootstrap import Bootstrap
...
bootstrap = Bootstrap(app)
If it's a full flask project, u need to do these:
from flask_bootstrap import Bootstrap
bootstrap = Bootstrap(app)
inside your __init__.py
file
© 2022 - 2024 — McMap. All rights reserved.