DRF | Django REST Framework
The de-facto standard for building REST APIs with Django. Also known as DRF.
Viewsets
Section titled “Viewsets”- A viewset1 is DRF’s version of a controller (Rails style)
Serializers
Section titled “Serializers”- Hyperlinked Fields2 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.
Footnotes
Section titled “Footnotes”-
Viewsets - Django REST Framework. https://www.django-rest-framework.org/api-guide/viewsets/#viewsets. Accessed 31 May 2024. ↩
-
Serializers - Django REST Framework. https://www.django-rest-framework.org/api-guide/serializers/. Accessed 31 May 2024. ↩ ↩2