<div class="flash-messages">
    {% for category, message in get_flashed_messages(with_categories=true) %}
        <div class="alert alert-{{ category }}">
            <button type="button" class="close" data-dismiss="alert">&times;</button>
            {{ message }}
        </div>
    {% endfor %}
</div>