Answers for "import messages dajngo"

4

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 %}
Posted by: Guest on April-15-2020
1

from django.contrib import messages

{% if messages %}
    {% for message in messages %}
    <p id="messages">{{message}}</p>
    {% endfor %}
{% endif %}
Posted by: Guest on May-28-2020

Python Answers by Framework

Browse Popular Code Answers by Language