django / django/new-features

Add Full Async Support for Django ORM

Open
#7 12 comments 87 reactions 0 assignees View on GitHub
Async Django Core Models/ORM
Dominant language
No language data
Stars
188
Forks
7
PR merge metrics
No merged PRs in 30d

Description

### Code of Conduct

- [x] I agree to follow Django's Code of Conduct

### Feature Description

Make Django's ORM fully support async operations, so we can `await` database queries directly without needing workarounds like `sync_to_async( )`.

### Problem

Right now, even though Django supports ASGI and async views, the ORM is still synchronous. This means when we hit the database inside an async view, it blocks a thread, and we lose the performance benefits of running an async server. We have to use extra things like `sync_to_async()`, which makes the code messier and not truly async. If the ORM could be used with `await`, Django apps could handle a lot more traffic, work better with real-time apps, and feel more modern overall.

### Request or proposal

request

### Additional Details

Adding full async ORM support would make Django even better for modern applications like real-time dashboards, high-frequency APIs, and IoT data platforms.

For example, in my own projects (like a Smart Community Data Platform handling IoT data), using a fully async ORM would help scale better and reduce latency by avoiding blocking calls in async views. Today, because Django's ORM is still synchronous, I sometimes choose other frameworks like FastAPI with Tortoise ORM when I need full async performance end-to-end.

However, I still prefer Django for many parts of my systems, especially for building admin panels, billing services, and reliable backend management features where Django’s strengths shine. I believe that with native async ORM support, Django could stay the first choice for both traditional and high-concurrency projects.

Thanks for considering this! I'm very excited about Django’s future with more async capabilities.

### Implementation Suggestions

These suggestions are inspired by patterns I've seen working well in other fully async Python frameworks like Tortoise ORM and SQLModel:

- Add async methods like aget(), acreate(), asave() to Django’s ORM, so developers can await database operations directly.
- Use async database drivers like asyncpg for Postgres connections under the hood.
- Allow QuerySets to be evaluated inside async contexts without blocking.
- Improve transaction management (like atomic blocks) to be async-friendly and safe in event loops.
- Maybe introduce this feature behind a settings flag first, like settings.USE_ASYNC_ORM = True, so people can opt in during early phases.

This way, async ORM support could be rolled out gradually in Django without breaking existing synchronous projects.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.