The Async Project is the effort to get Django async-compatible as part of the 3.x series. It's one of the biggest overhauls of Django in its history, and this page is the hub for what's happening, and how you can help.

Where to discuss

If you want to talk about any of this, come to the Async category in the Django Forum! (https://forum.djangoproject.com/c/internals/async)

Current status

Complete:

  • ASGI Support: Having Django speak the ASGI (async successor to WSGI) protocol

In progress:

  • Async views: Allowing for async def views

Planned/Future:

  • ORM: Making the ORM async-capable
  • Templating: Making templates async-capable
  • Cache: Async cache abstraction (get/set/etc.)
  • Test Client: Better async support for tests

Other areas of Django also need attention; this is by no means the full set of projects that need tackling.

How to help

These are the areas we currently need help in; if you're interested, please email andrew at aeracode.org (we'll get a better way of organizing this done soon).

Test failure chasing

The current async views branch runs code mostly successfully, but some Django tests fail, occasionally in odd ways. There's a lot of valuable work in taking a test failure and working out the root cause so it can be fixed in the async views patch. This is especially important to trace down places where database connections are accessed from more than one thread (which is invalid, but happens with incorrect use of sync code in an async thread).

Class-based views

There needs to be an async version of these (either as_async_view, or a new base class)

Async namespace helper

We want to namespace things as cache.a.get - this could do with a helper class that can be provided as the "async" member on classes and automatically proxy some things through to the sync versions.

Async test client

There needs to be a async test client with methods like client.a.get or AsyncClient.

Benchmarking

Performance regressions are the one thing we want to avoid, and so the djangobench (https://github.com/django/djangobench) project needs modifying to add an ASGI benchmark path and the ability to compare sync-via-sync, sync-via-async and async-via-async paths through Django, as well as between 2.2 and 3.0/3.1 with the async views changes applied.

Documentation

We need a significant amount of new documentation about asynchronous code and when it makes sense (and cruicially, when not to use it). This could potentially take the form of a new tutorial section, more narrative-style documentation, as well as more notes about Django's internals and how they are changed.

Test writing

We need some more tests written for the async support already in Django 3.0, as well as the asynchronous view code that's currently in a branch. Ideally we want tests for both the sync and async paths, and more tests that run things in parallel to verify there's no concurrency issues.

Example projects

A well-documented example project with a good use of async could be a very valuable resource for people to learn from.

ORM/Template/Cache project lead

If you're experienced enough in large codebases and async code, these projects can each be tackled and run separately and we'd benefit a lot from doing them in parallel. Templating and the ORM especially need research and prototyping as a first phase before we work out what the best solution is.

Fundraising

Help with planning fundraising is most welcome!

Last modified 5 years ago Last modified on Sep 26, 2019, 6:39:18 PM
Note: See TracWiki for help on using the wiki.
Back to Top