Flask-Bootstrap can be installed with pip
pip install flask-bootstrap
Flask extensions are usually initialized at the same time the application instance is created.
from flask import request,redirect,abort
from flask import Flask, render_template
from flask_bootstrap import Bootstrap
app = Flask(__name__)
bootstrap = Bootstrap(app)
if __name__ == '__main__':
app.run(debug = True)
Flask-Bootstrap is imported from the flask.ext namespace and initialized by passing the application instance in the constructor.
Once Flask-Bootstrap is initialized, a base template that includes all the Bootstrap files is available to the application. This template takes advantage of Jinja2s template inheritance; the application extends a base template that has the general structure of the page including the elements that import Bootstrap.
Everything you do in child templates is based on blocks. Some blocks (like title, navbar or content) are convenience blocks. Strictly speaking they would not be necessary, but are added to save typing effort.
A very powerful feature is Jinjas super() function. This gives you the option of amending blocks instead of replacing them.