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

Solution: Import the 'TemplateSyntaxError' module

# Add the following line to the top of your code
from django.template import TemplateSyntaxError

 

For more information:
django TemplateSyntaxError