Django Messages - message levels


Django tip:

By default, the lowest recorded message level, from Django's messages framework, is 20 (INFO).

That means that all message levels but DEBUG (with value 10) are displayed.

You can change the default MESSAGE_LEVEL to a higher or lower level in the settings:

# settings.py
from django.contrib.messages import constants as messages

# all message levels will be displayed:
MESSAGE_LEVEL = messages.DEBUG

# only messages with level WARNING and ERROR will be displayed:
MESSAGE_LEVEL = messages.WARNING