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

Erorr: name 'Serializer' is not defined

NameError: name 'Serializer' is not defined

Solution: Import the 'Serializer' module

# Add the following line to the top of your code
from django.contrib.gis.serializers.geojson import Serializer

 

For more information:
django Serializer