[Django]-Serializer call is showing an TypeError: Object of type 'ListSerializer' is not JSON serializable?

58👍

The problem is that you’re sending the serializer itself, rather than the serialized data, to the response. You should change it to:

self.data = objects.data

But that said, most of this code is totally unnecessary, You’re bypassing most of .he things that Django and DRF do for you already. Remove your mixin and use a ListAPIView.

Leave a comment