Django's Tasks Framework in Django 6.0

There is lots of excitement about the new Django Tasks Framework coming in Django 6, but will there be any way to use it for background tasks when it launches? I can see that for the initial release it only includes the Immediate and Dummy backends, but neither of these can be used for background tasks (as far as I can tell?)

I’ve read Jake’s blog post and the Django docs, but I can’t quite figure out the initial use-case for this.

(please don’t take this negatively or as criticism - I’m stoked to see the progress!)

I believe you still need to install django-tasks the third party package to get the database backend and worker to use the feature.

I believe this initial release is a stable API for other background task packages (eg Celery etc) to work against to provide a compatibility with this new API.

At least the above is my understanding. I will know more next week as I plan to upgrade a project to 6.0 to use tasks myself!

You’re exactly right. Much like the introduction of ASGI, the introduction of django.tasks is phased. The first part, introduced in Django 6.0 is the core building blocks and fundamnetal APIs. The “Immediate” and “Dummy” workers are also included so there’s a reasonable fallback and something useful in testing.

The database worker will come later (no ETA), but other backends will likely be maintained as 3rd-party packages (akin to cache backends).

1 Like