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

Erorr: name 'ValidationError' is not defined

NameError: name 'ValidationError' is not defined

Solution: name 'ValidationError' is not defined

# Add the following line to the top of your code
from django.core.exceptions import ValidationError

 

For more information:
Django ValidationError

If the error has not been solved: