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