Messaging a Logged-in User
The messages framework uses middleware to make any outstanding notifications for the user available in any view. By default, messages support five levels:
The messages framework is used primarily for asynchronous communication with the user. For example, if a background job goes wrong, then you can inform the user by sending a message with the
This code uses a list of
messages in the template context that’s put there by the middleware. If there are messages, then an HTML unordered list is created showing each of them. Visit the
/add_messages/ URL to create some messages as seen onscreen here, and then go to the blog listing page at the root of the site to see them.
Become a Member to join the conversation.