Flask flash messages as Bootstrap alert
Flask flash messages as Bootstrap alert.
{% with messages = get_flashed_messages(with_categories=true) %}
<!-- Categories: success (green), info (blue), warning (yellow), danger (red) -->
{% if messages %}
{% for category, message in messages %}
<div class="alert alert-{{ category }} alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
<!-- <strong>Title</strong> --> {{ message }}
</div>
{% endfor %}
{% endif %}
{% endwith %}
Written by Victor Kristof
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Flask
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#