flask中flash不显示
需要在html文件中body中加入下列语句
<div class='container'>
<div class="row">
{% with messages = get_flashed_messages() %}
{% for message in messages %}
{% if message %}
<div class="alert alert-warning" role="alert">{{ message }}</div>
{% endif %}
{% endfor %}
{% endwith %}
{% if form and form.errors %}
{% for key, error in form.errors.items() %}
<div class="alert alert-warning" role="alert">{{ error }}</div>
{% endfor %}
{% endif %}
</div>
</div>