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

Solution: Import the 'messages ' module

# Add the following line to the top of your code
from django.contrib import messages 

 

For more information:
django messages