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
Serializers validate input and shape output, like forms for JSON.
ModelViewSet plus a router gives a complete CRUD API in a few lines.
Set authentication and permission classes globally in RESTFRAMEWORK settings.
Use APIClient to test endpoints with JSON payloads.