Deep dive into Django REST Framework's most powerful view, ViewSets.
Django REST Framework (DRF) is a widely-used, full-featured API framework designed for building RESTful APIs with Django. At its core, DRF integrates with Django's core features -- models, views, and URLs -- making it simple and seamless to create RESTful HTTP resources.
DRF is composed of the following components:
- Serializers are used to convert Django querysets and model instances to (serialization) and from (deserialization) JSON (and a number of other data rendering formats like XML and YAML).
- Views (along with ViewSets), which are similar to traditional Django views, handle RESTful HTTP requests and responses. The view itself uses the serializers to validate incoming payloads and contains the necessary logic to return the response. Views are coupled with routers, which map the views back to the exposed URLs.
The articles and tutorials on TestDriven.io are on the more intermediate to advanced side that cover permissions, serializers, and Elasticsearch.
Latest Posts (8)
Use Django REST Framework's Generic Views to prevent repeating certain patterns over and over again.
Deep dive into how Django REST Framework's views work and its most basic view, APIView.
Looks at how to integrate Django REST Framework with Elasticsearch.
How to build custom permission classes in Django REST Framework.
How the built-in permission classes work in Django REST Framework.
How permissions work in Django REST Framework.
Deep dive into Django REST Framework (DRF) serializers.