Flash messages with categories

PHOTO EMBED

Mon Feb 14 2022 09:17:56 GMT+0000 (Coordinated Universal Time)

Saved by @mirelspr #python

flash(u'You are about to delete everything!', 'alert-danger')

{% with messages = get_flashed_messages(with_categories=true) %}
  {% if messages %}
    {% for category, message in messages %}
      <div class="alert {{category}}" role="alert">
        {{message}}
      </div>
    {% endfor %}
  {% endif %}
{% endwith %}
content_copyCOPY

https://stackoverflow.com/a/58219849/10753968