DRF | Django REST Framework
The de-facto standard for building REST APIs with Django. Also known as DRF.
Viewsets
Section titled “Viewsets”- A viewset[^1] is DRF’s version of a controller (Rails style)
Serializers
Section titled “Serializers”- Hyperlinked Fields[^2] use a lookup_field attribute (found in
Meta.extra_kwargs). It defaults to pk. - The DRF docs advise that you leverage repr on the HyperlinkedModelSerializer class in the django shell.
[^1]: Viewsets - Django REST Framework. https://www.django-rest-framework.org/api-guide/viewsets/#viewsets. Accessed 31 May 2024. [^2]: Serializers - Django REST Framework. https://www.django-rest-framework.org/api-guide/serializers/. Accessed 31 May 2024.
Measuring CO2… Website Carbon