django-rest-framework Serializers


According to DRF official documentation, serializers helps to convert complex data like querysets and model instance to native python data types so that it could be rendered as JSON, XML and other content types.

The serializers in DRF are more like django Form and ModelForm class. Serializer class provide us a custom way to handle the data like django Form. And ModelSerializer class provide us a easy way to handle model based data.