0PricingLogin
Django Academy · Lesson

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

  1. Installing and Configuring DRF
  2. Serializers: Model to JSON
  3. APIView and Function @api_view
  4. The Browsable API and Status Codes
← Back to Django Academy