Chartjs-Chart.js doesn't show chart while on flask blueprint

0👍

Does the browser inspector give you any error which helps us to answer it?

Maybe it has to do with your blueprint static folder structure or the js url in the HTML file.

For each blueprint you can optionally specify a template_folder:

training_blueprint = Blueprint('training_blueprint', __name__,
                        template_folder='templates')

More information
https://hackersandslackers.com/flask-blueprints/

In your HTML you can replace

<script src='static/Chart.min.js'></script>

with

<script src="{{ url_for('static', filename='Chart.min.js') }}"></script>

Leave a comment