Development of an internal social media platform with personalised dashboards for students
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

context_processors.py 354B

12345678910111213
  1. from django.contrib.messages.api import get_messages
  2. from django.contrib.messages.constants import DEFAULT_LEVELS
  3. def messages(request):
  4. """
  5. Return a lazy 'messages' context variable as well as
  6. 'DEFAULT_MESSAGE_LEVELS'.
  7. """
  8. return {
  9. 'messages': get_messages(request),
  10. 'DEFAULT_MESSAGE_LEVELS': DEFAULT_LEVELS,
  11. }