[Django]-Implement get_serializer in generic list view (generics.ListCreateAPIView) in Django REST Framework

1👍

The error you are seeing is because you didn’t declare a serializer_class or model attribute on your view. If you don’t specify those you must override get_serializer_class() to tell the view which serializer to use.

Also you said:

but when I try to initialize my PageSerializer in the list view (which inherits from generics.RetrieveUpdateDestroyAPIView) I get the following error:

A list view should inherit from one of the generic list views like ListCreateAPIView, not a single object view like RetrieveUpdateDestroyAPIView.

Leave a comment