Django REST framework adds serializers, views, routers, and authentication helpers so Django projects can expose browsable HTTP APIs. It supports ORM-backed and non-ORM data sources with optional OAuth packages.
Overview
Django REST framework is a Python toolkit that sits on top of Django to define REST-style HTTP APIs. Developers describe resources with serializer classes, attach viewsets or function views, and wire routes through routers that generate URL configuration from registered endpoints.
A distinctive feature is the browsable API HTML interface, which lets developers explore, create, and edit resources from a browser when the login views are enabled. Global behavior is controlled through a RESTFRAMEWORK settings dictionary, including default permission classes such as Django model permissions or anonymous read-only access.
Authentication support includes optional integrations for OAuth 1a and OAuth 2 mentioned in the overview, and serialization is designed to work with Django models as well as arbitrary data. The project documents quickstart flows using manage.py runserver and shows curl examples for listing and creating users.
Optional packages extend schema generation, markdown rendering for the browsable API, filtering, and object-level permissions. Installation is pip-based, with rest_framework added to INSTALLED_APPS on an existing Django project.
Key features
- Serializers for API request and response shapes
- ViewSets and routers for automatic URL routing
- Browsable web API for interactive testing
- Configurable permission and authentication policies
- ORM and non-ORM serialization support
- Optional OAuth, filtering, and schema packages
- Hyperlinked and model-backed API patterns
Use cases
- Exposing Django models as JSON HTTP APIs
- Building internal APIs with browser-based exploration
- Prototyping CRUD endpoints with viewsets and routers
- Integrating third-party clients via standard HTTP methods