Различные предупреждения bootstrap (V 4.0) отображаются не так, как ожидалось
{% if form.errors %}
<div class="alert alert-danger" role="alert">
{% for field in form %}
<p>{{field.errors}}</p>
{% endfor %}
</div>
{% endif %}
{% if messages %}
<div class="alert alert-success" role="alert">
{% for message in messages %}
<p>{{message}}</p>
{% endfor %}
</div>
{% endif %}
Это проект Django и выше приведен порядок, в котором я разместил оповещения. Дело в том, что все оповещения отображаются в виде alert-danger, т.е. оба form.errors & message отображаются внутри alert-danger. Как мы можем избежать этой проблемы?