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