Not every Django project renders HTML. Mobile apps, single-page front ends, and other services all need data in a machine-readable form, usually JSON served over a REST API. Django REST Framework (DRF) is the standard toolkit for building these APIs on top of the models, views, and authentication you have already learned.
In this module you will learn how serializers convert models to
JSON and validate incoming data, how to write API views with DRF's
Response objects, and how viewsets and
routers generate full CRUD endpoints with very little code. You
will also see how API authentication and permissions control who can read or
change your data.
Watch the lessons in order, then continue on to Testing & Debugging. Some of these videos were recorded on older Django and DRF releases, so check the official documentation if a detail differs on your install.
Covers adding REST Framework to a project, creating a ModelSerializer, field-level validation, returning serialized data from a view, the Response object, and the browsable API.
Walks through installing DRF, creating serializers, building a ViewSet, and wiring up URLs with SimpleRouter and DefaultRouter.
Builds a Django REST API using viewsets, serializers, and routers to provide full CRUD endpoints.
Builds endpoints for user registration, login, and logout, and adds authentication and permissions to protect API access.