QuickDevGuide

Home › Django

REST APIs with Django REST Framework — Django

DRF (pip install djangorestframework) adds serializers, viewsets, routers, auth, throttling and a browsable API. Piece Role ModelSerializer model ⇄ JSON with validation APIView / generics request handling with content negotiation ModelViewSet list/create/retrieve/update/destroy in one class DefaultRouter generates URLs for viewsets permissionclasses IsAuthenticated, IsAdminUser, custom paginationclass / filterbackends paging, search, ordering Add "restframework" to INSTALLEDAPPS, then include router.urls.

Key Takeaways