How to Solve NameError: name 'messages' is not defined -- django

Solution: Import the 'messages' module

To Solve the error, add the following line to the top of your code.

from django.contrib import messages

 

For more information:
Python django messages