How to Solve NameError: name 'FieldDoesNotExist' is not defined -- django
Solution: Import the 'FieldDoesNotExist' module
To Solve the error, add the following line to the top of your code.
from django.core.exceptions import FieldDoesNotExist
For more information:
Python django FieldDoesNotExist