Serializers: Model to JSON
Convert objects to and from JSON.
The Translator Layer
A serializer is DRF's translator: it converts your model instances into JSON to send out, and parses incoming JSON back into Python.
Why Not Just json.dumps?
Raw json.dumps cannot handle model objects or validation. A serializer understands fields, types, and rules, so it does the heavy lifting for you.
All lessons in this course
- Installing and Configuring DRF
- Serializers: Model to JSON
- APIView and Function @api_view
- The Browsable API and Status Codes