Django REST Framework
A powerful and flexible toolkit for building Web APIs
Overview
Django REST Framework is a powerful and flexible toolkit for building Web APIs with Django. It provides a comprehensive set of tools that make it easy to build RESTful APIs quickly and efficiently.Quick Start
Get started with Django REST Framework in minutes
Tutorial
Learn through our comprehensive step-by-step tutorial
API Reference
Explore the complete API documentation
Community
Join the community and find resources
Why Django REST Framework?
Web Browsable API
Web Browsable API
The web browsable API is a huge usability win for your developers. It provides an interactive interface for exploring and testing your API endpoints directly in the browser.
Powerful Serialization
Powerful Serialization
Comprehensive serialization system that supports both ORM and non-ORM data sources. Convert complex data types like Django model instances to native Python datatypes that can be easily rendered into JSON, XML, or other content types.
Authentication & Permissions
Authentication & Permissions
Flexible authentication including packages for OAuth1a and OAuth2. Granular permission controls to ensure your API is secure and accessible only to authorized users.
Customizable All The Way Down
Customizable All The Way Down
Use regular function-based views if you don’t need the more powerful features. The framework is designed to be customizable at every level, from serializers to views to routers.
Key Features
- Powerful serialization system supporting both ORM and non-ORM data sources
- Class-based and function-based views with generic views and viewsets
- Automatic URL routing with routers
- Flexible authentication including session, token, and OAuth support
- Granular permission controls for fine-grained access management
- Built-in pagination, filtering, and throttling for production-ready APIs
- Web browsable API for easy debugging and exploration
- Multiple renderer support including JSON, XML, YAML, and more
- Comprehensive content negotiation for handling different client requirements
- Extensive validation and error handling for robust API development
Requirements
Django REST Framework requires Python 3.10+ and Django 4.2+
- Python: 3.10, 3.11, 3.12, 3.13, 3.14
- Django: 4.2, 5.0, 5.1, 5.2, 6.0
Installation
Install Django REST Framework using pip:rest_framework to your INSTALLED_APPS setting:
settings.py
Example
Here’s a quick example of using REST framework to build a simple model-backed API:urls.py
settings.py:
settings.py
http://127.0.0.1:8000/ and view your new users API.
Next Steps
Installation Guide
Detailed installation and configuration instructions
Quickstart Tutorial
Build your first API in minutes
Step-by-Step Tutorial
Complete tutorial series covering all major features
API Reference
Comprehensive API documentation
Community & Support
GitHub
Star us on GitHub and contribute
Discussion Group
Ask questions and get help
Security Policy
Report security vulnerabilities
