<django.contrib.messages.storage.fallback.FallbackStorage object at 0x000002AA36463610> code example

Example 1: django read mesage

{% if messages %}
<ul class="messages">
    {% for message in messages %}
    <li{% if message.tags %} class="{{ message.tags }}"{% endif %}>
        {% if message.level == DEFAULT_MESSAGE_LEVELS.ERROR %}Important: {% endif %}
        {{ message }}
    </li>
    {% endfor %}
</ul>
{% endif %}

Example 2: django read mesage

{% if messages %}
<ul class="messages">
    {% for message in messages %}
    <li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li>
    {% endfor %}
</ul>
{% endif %}

Example 3: from django.contrib import messages

{% if messages %}
    {% for message in messages %}
    <p id="messages">{{message}}</p>
    {% endfor %}
{% endif %}