2009-12-10 00:57:23 +08:00
|
|
|
from django.contrib.messages.api import get_messages
|
2013-10-29 04:52:11 +08:00
|
|
|
from django.contrib.messages.constants import DEFAULT_LEVELS
|
2009-12-10 00:57:23 +08:00
|
|
|
|
|
|
|
|
|
|
|
def messages(request):
|
|
|
|
"""
|
2017-01-25 04:31:57 +08:00
|
|
|
Return a lazy 'messages' context variable as well as
|
|
|
|
'DEFAULT_MESSAGE_LEVELS'.
|
2009-12-10 00:57:23 +08:00
|
|
|
"""
|
2013-10-29 04:52:11 +08:00
|
|
|
return {
|
|
|
|
'messages': get_messages(request),
|
|
|
|
'DEFAULT_MESSAGE_LEVELS': DEFAULT_LEVELS,
|
|
|
|
}
|