10

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
Billal Begueradj
  • 20,717
  • 43
  • 112
  • 130
Ameida
  • 153
  • 1
  • 1
  • 9

4 Answers4

21

You need to import Bootstrap in this way below:

from flask_bootstrap import Bootstrap
...
bootstrap = Bootstrap(app)

flask.ext.bootstrap is deprecated

user83655
  • 334
  • 2
  • 4
2

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.

1

Need to import Bootstrap from flask.ext.bootstrap and bootstrap the flask app as below:

from flask.ext.bootstrap import Bootstrap
...
bootstrap = Bootstrap(app)
Ameida
  • 153
  • 1
  • 1
  • 9
1

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

fill_J
  • 459
  • 5
  • 13