Grokking Django
Vote

0% completed

​

Understanding Serializers in DRF

Turning a Python object into a form that can be sent over the network, such as JSON text, is called serialization. The reverse, turning received text back into checked Python data and then into an object, is deserialization. In DRF, a single class does both jobs for one kind of object, and that class is a serializer.

The plain Django API earlier in this chapter did this work by hand. It built a dictionary field by field for every response, and it parsed and checked every field of a POST body with its own if statements. A serializer replaces both parts. This lesson works in `python manage

.....

.....

.....

Like the course? Get enrolled and start learning!

Reading Progress

0%


Vote for new content