django-aiodrf documentation¶
aiodrf adds awaitable views, serializer operations and policy hooks to Django REST framework. Existing DRF components keep working. Synchronous code that aiodrf cannot prove free of I/O runs in a worker thread, so an async view never blocks the event loop on it; an async view does not, however, make a synchronous dependency such as the database driver asynchronous.
Getting started¶
- Install the package and write a first view: see the README.
- Run the basics or CRUD and filtering example.
- When adapting an existing project, follow the DRF integration guide.
- Test your API with the testing guide.
Reference¶
- API reference: views, serializers, hooks and optional modules.
- Settings: defaults, accepted values and when each setting takes effect.
- System checks: every check, its cause and how to resolve it.
- Limitations: what aiodrf does not do, and where its guarantees end.
- Extension hooks: sync/async pairs, inheritance, exceptions, conditional requests and query validation.
- HTTP QUERY: request bodies for read queries.
- Serializer data types.
- Runtime adaptations and upstream internals: what aiodrf changes in Django and DRF when asked to, and which of their private names it relies on.
- Versioning and compatibility.
Building applications¶
- Best practices.
- Transactions in async views and Django fetch modes.
- Lifespan, management commands and Django Tasks.
- Streaming responses and static files under ASGI.
- Batch enrichment and concurrent representation.
- Native async cache, cache failure handling and NoSQL databases.
- Native PostgreSQL backend.
- Independent ASGI endpoints.
- Examples.
Integrations¶
- Tested third-party packages and their recorded versions.
- Optional dependencies.
- Compatibility with DRF's own test suite.
Performance¶
- Tuning and measuring performance.
- Serializer backends and selective serializer optimization.
- The tuned profile: each opt-in, its effect and its risks.
- CPU-bound work.
Deployment¶
Migration¶
Design¶
- Framework design and the implementation reference.
- Bridge pattern, thread boundaries, state ownership, naming and alternatives considered.
Project¶
- Changelog and roadmap.
- Contributing, code of conduct and security policy.