DRF
This folder has no README. Everything inside it is listed below.
Notes
- Django and DRF: the request path 5 Django REST Framework sits on Django's view layer and adds serializers, class-based API views and viewsets, routers, content negotiation, and pluggable…
- DRF Serializers 5 A serializer is two-way: it serializes model instances → primitive dicts (then JSON) and deserializes request payloads → validated Python data → model…
- DRF Validation 5 Validation in DRF runs in a fixed order.
- DRF Views: APIView, GenericAPIView, ViewSet 5 DRF gives you a ladder of view classes. Each rung trades flexibility for boilerplate.
- DRF Routers and Custom Actions 5 Routers turn a ViewSet class into a set of URLs by inspecting the action methods on the class.
- DRF Permissions 6 Permissions answer "is this request allowed to do this?" after authentication has answered "who is this?".
- DRF Authentication 5 Authentication identifies the user. It runs first in the request lifecycle, before permissions and throttles.
- DRF Throttling 5 Throttles cap request rates. They run after authentication and permissions.
- DRF Pagination 5 Pagination caps the size of list responses.
- DRF Filtering, Searching, Ordering 5 Three concerns, three backends. They're configured the same way (via filter_backends) but solve different things:
- DRF Nested Writable Serializers 5 Nested serializers are easy to read, hard to write.
- DRF Performance and the N+1 Problem 6 DRF's biggest performance footgun is N+1: a list endpoint serializes 100 objects, and each object triggers an extra query.
- Testing DRF APIs 5 DRF ships its own test client (APIClient) and helpers.
- DRF Exception Handling 5 DRF translates exceptions into HTTP responses through a single function: rest_framework.views.exception_handler.
- DRF Versioning 5 Versioning lets you evolve an API without breaking existing clients.
- DRF Schema and OpenAPI 5 Schemas describe your API in a machine-readable format (OpenAPI 3 / Swagger).