How to include styles in jinja2

By default, the styles should be located in the folder static at the root directory level.

The connection will be like this:

{% block head%}
<link rel=“stylesheet” href=“{{url_for (‘static’, filename =” styles.css “, v = ‘1’)}}”>
{% endblock%}

Default styles for jinja2 should be located in the root directory of the site in the folder static otherwise there will be an error.

The “default” directory can be overridden, but typical commands did not work for me during Flask for this, therefore I will not give them.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *