{% for message in messages %}
    <div class="{% if message.tags == "error" %}bg-danger{% elif message.tags == "success" %}bg-success{% else %}bg-info{% endif %}"
            style="padding: 5px;margin: 5px auto">
        <h5><span style="font-weight: 900;">{{ message }}</span></h5>
    </div>
{% endfor %}