Answers for "how to import messages in django"

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
0

where to import messages in django

from django.contrib import messages

messages.info(request, 'Three credits remain in your account.')
messages.success(request, 'Profile details updated.')
messages.warning(request, 'Your account expires in three days.')
messages.error(request, 'Document deleted.')
messages.debug(request, '%s SQL statements were executed.' % count)
Posted by: Guest on August-25-2021

Python Answers by Framework

Browse Popular Code Answers by Language