django-aiodrf
Awaitable views, serializers and policy hooks for Django REST framework.
aiodrf extends DRF's classes and preserves its request, validation and response contracts. Migrate endpoints incrementally: async implementations are awaited; synchronous hooks that may perform I/O execute in a thread-sensitive worker. Existing DRF serializers, routers, authentication and permission classes remain usable.
The first release is version 0.0.1. The package is alpha and its API may change.
The distribution name is django-aiodrf; imports use aiodrf.
Installation
For this development checkout:
uv venv --python 3.12
uv pip install -e .
Install with uv:
uv add django-aiodrf
Install with pip:
pip install django-aiodrf
Optional dependencies are selected explicitly, for example
django-aiodrf[filter,spectacular].
Add the application to Django settings:
INSTALLED_APPS = [
# Your existing Django applications.
"rest_framework",
"aiodrf",
]
Keep authentication, permission, parser and renderer configuration in
REST_FRAMEWORK. Optional aiodrf behavior is configured through AIODRF;
the default configuration requires no optimization settings.
Basic usage
# project/urls.py
from django.urls import path
from aiodrf.response import Response
from aiodrf.views import APIView
class StatusView(APIView):
async def get(self, request):
return Response({"status": "ok"})
urlpatterns = [
path("status/", StatusView.as_view()),
]
Serve the project with an ASGI server. aiodrf's aiodrf.asgi.get_asgi_application()
is needed only for its optional features, such as the
lifespan context manager.
For model APIs, aiodrf provides ModelViewSet, generic views and serializers
with async methods. Plain DRF serializers can also be used through
aiodrf.aio.is_valid(), save() and data(). Supported extension hooks have
explicit sync/async pairs such as get_queryset() / aget_queryset().
Capabilities and boundaries
- DRF-style views, routers, validation, authentication, permissions and throttling.
- Awaitable serializer operations and compatible synchronous extension hooks.
- Typed lifespan resources, streaming responses and conditional requests.
- Optional msgspec/Pydantic serializers, compiled serializer backends (msgspec, Pydantic, or plain Python without a dependency) and selective field-copy optimizations.
- Tested integrations for filtering, OpenAPI, object permissions, caching, background tasks and SQL/NoSQL access.
Django's async ORM methods still run the database driver synchronously, in a
worker thread; await alone does not make database access natively
asynchronous. aiodrf keeps synchronous code it cannot verify off the event
loop. Compiled serializers, the native database backend and the compatibility
layers are opt-in, and their guides describe their limits. How much faster an
async API is depends on the application and its deployment.
Compatibility
Python 3.12, 3.13 and 3.14, including a separate free-threaded test session:
| Django | DRF |
|---|---|
| 5.2 | 3.16, 3.17, 3.18 |
| 6.0 | 3.17, 3.18 |
| 6.1 | 3.18 |
Tests run on SQLite and PostgreSQL, against DRF's own test suite and with a selection of third-party packages; the ecosystem guide lists them.
Documentation
The aiodrf documentation covers migration, configuration, the API reference and the examples, which run locally with uv or with Docker Compose.
Use the Django documentation for models, middleware, settings and deployment, and the Django REST framework documentation for DRF's API. aiodrf's guides describe what aiodrf adds and do not repeat those references.
Development
uv pip install -e . --group dev
uv run --no-sync pytest
uv run --no-sync nox -s lint typecheck docs
The contribution guide describes the development workflow, the test sessions and the code standards.
Credits
django-aiodrf builds on Django REST framework. Thank you to the DRF team and contributors for its API design, implementation, documentation and compatibility tests, and to the Django and asgiref contributors for the request handling and async infrastructure it relies on. Adapted source code keeps its license notices and attribution.
django-aiodrf is an independent project. It is not part of Django or DRF, nor endorsed by them.
Metadata
Release files for django-aiodrf 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| django_aiodrf-0.0.1.tar.gz | 1.5 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| django_aiodrf-0.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 1.8 MB
Release files / django_aiodrf-0.0.1.tar.gz
| Download URL | django_aiodrf-0.0.1.tar.gz |
|---|---|
| Size | 1.5 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1f523a914d3a7c4e9bc3f2d59c02ea27e7a2dbc3dbe25115dc2d488b9779af6f
|
|
BLAKE2b-256 checksum How to use checksums |
8a8ca3aa9876b746aa553d8da558523f05da99419a10351d470da13ac5d8e432
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 30, 2026.
Transparency logRelease files / django_aiodrf-0.0.1-py3-none-any.whl
| Download URL | django_aiodrf-0.0.1-py3-none-any.whl |
|---|---|
| Size | 288.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c80a66b015a1563385797ad9a67917d6839454ee5a81a702c0b7d8fde9a5b233
|
|
BLAKE2b-256 checksum How to use checksums |
0c8395c9f5eb276c9a575d304d9d55e48423c038d6c630bf8e8c426f9f7f97cb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 30, 2026.
Transparency log