Answers for "messages tag django"

2

django messages

{% if messages %}
<ul class="messages">
    {% for message in messages %}
    <li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li>
    {% endfor %}
</ul>
{% endif %}
Posted by: Guest on April-15-2020
0

django messages

from django.contrib import messages
messages.add_message(request, messages.INFO, 'Hello world.')
Posted by: Guest on April-20-2020

Python Answers by Framework

Browse Popular Code Answers by Language