Tsallaka zuwa abun ciki
Justice Tech School

The Messages Framework

Messages show one time notices such as Saved successfully. Add them in views and print them in templates.

Example
from django.contrib import messages

messages.success(request, "Saved!")

{% for m in messages %}
  <div class="{{ m.tags }}">{{ m }}</div>
{% endfor %}

Exercise

Show a success message.

messages.(request, "Saved")

Quiz Test

How long do messages last?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.