[Solved] Re-Ask: Whats wrong with the Flask-Bootstrap?


There is an issue with the way you are initializing flask-bootstrap. This how you should go about it:

# Your previous imports
from flask_bootstrap import Bootstrap

app = Flask(__name__)

bootstrap = Bootstrap(app)

# ...

Basically, update the line:

Bootstrap(app)

to:

bootstrap = Bootstrap(app)

This is exactly what you have done for the other installed packages too.

Maintain the line {% extends 'bootstrap/base.html' %} in your base template (which is the parent template). Do not change it to {% extends 'bootstrap/index.html' %} This file inherits the styles, layout, features etc from bootstrap’s base template.

<!-- base.html -->




{% extends 'bootstrap/base.html' %}

{% block head %}
    <!-- Head information goes here -->
{% endblock %}

{% block navbar %}
    <!-- Your navbar goes here -->
{% endblock %}

{% block content %}
<!-- flash message goes here -->

    {% block app_content %}
        <!-- Content from your custom HTML templates will go here -->
    {% endblock %}

{% endblock %}

{% block scripts %}
    <!-- Your scripts go here -->
{% endblock %}

In your index.html file which inherits your base,html, you will do:

<!-- index.html -->


{% extends 'base.html' %}

{% block app_content %}
    <!-- Content goes here -->
{% endblock %}

2

solved Re-Ask: Whats wrong with the Flask-Bootstrap?