REST for Djangos
REST in Django means building HTTP APIs, usually with Django REST Framework. Serializers convert models to JSON and validate input, views and viewsets handle requests, routers generate URLs, and pagination, filtering and throttling shape responses. API documentation with OpenAPI keeps clients and teams aligned with the real behaviour.
Stage: APIs and Auth · Part of the Django roadmap · Last reviewed 19 November 2026
What to learn in REST
- Write a ModelSerializer with validation
- Build an API with ModelViewSet and a router
- Add pagination and filtering to a list endpoint
- Return correct status codes and error responses
- Generate OpenAPI documentation for the API
- Version an API and apply throttling
REST interview questions
What does a serializer do in Django REST Framework?
A serializer converts complex objects such as model instances into Python types that render as JSON, and converts incoming data back into validated objects. It also defines which fields are exposed and applies validation rules.
What is the difference between APIView, generic views and ViewSets?
APIView gives full control, where you write each method. Generic views provide common behaviour such as list and create using mixins. ViewSets group related actions into one class, and with routers generate URLs automatically, reducing repeated code.
Where REST fits in the Django roadmap
REST belongs to the APIs and Auth stage (intermediate level), which takes about 20 hours. Build the backend.
Other units in this stage
Back to the full Django roadmap