skillfed

django-tasks

A backport of Django's built in Tasks framework

django-tasks v0.12.0 858.6K downloads/30d#4,880 on PyPI810
Permissive license BSD-3-Clause Active released

What it is and what it does

django-tasks is a backport of Django's native Tasks framework, letting you define and execute background tasks within a Django application. You decorate functions with @task(), enqueue them on demand, and get back a TaskResult object to track status and retrieve return values. The framework abstracts the execution layer behind pluggable backends—by default it runs tasks immediately in the current thread, but you can swap in other backends for deferred or distributed execution.

The package is designed to integrate seamlessly with Django's configuration and signals system. You can customize tasks with priority levels, queue names, and delayed execution times; retrieve results later by ID; and introspect backend capabilities at runtime to gracefully degrade if a feature isn't supported. It's a lightweight alternative to external task queues when you need basic async task support without additional infrastructure.

Use it for:

  • Offload long-running operations (reports, data processing) from request handlers to avoid blocking responses.
  • Schedule tasks to run at specific times or with custom priority levels using the priority and run_after parameters.
  • Test task logic in isolation using the DummyBackend without actually executing tasks during test runs.
  • Track task execution status and retrieve results asynchronously across different parts of your application.
  • Swap task backends (immediate, database, RQ) without changing task definitions by reconfiguring the TASKS setting.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides a backport of Django's built-in Tasks framework, enabling you to define, enqueue, and manage asynchronous tasks with pluggable backends for execution.

Yes. django-tasks is actively maintained, has no known vulnerabilities, and provides a lightweight, Django-native way to handle background tasks. Install it if you need basic task queueing without external infrastructure; the low install friction and permissive license make it a straightforward addition. Consider it especially if you're already committed to Django and want to avoid pulling in a separate task queue system.

Install

django-tasks on PyPI

pip

pip install django-tasks

uv

uv add django-tasks

poetry

poetry add django-tasks

Installing django-tasks

Before you install

Low install friction; pure Python wheel. Actively maintained with recent commits and a stable release cadence. Requires Django and typing_extensions as runtime dependencies.

License in practice

BSD-3-Clause is permissive; you may use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.

Quickstart

pip install django-tasks

# In settings.py
INSTALLED_APPS = ["django_tasks"]

# In your code
from django_tasks import task

@task()
def my_task():
    return 42

result = my_task.enqueue()
print(result.return_value)

Requires Python 3.10 or later and Django 4.2+. Must add django_tasks to INSTALLED_APPS and configure a backend (defaults to ImmediateBackend if omitted).

Verify before relying

  • Whether the included ImmediateBackend and DummyBackend are sufficient for production use or if external backends (django-tasks-db, django-tasks-rq) are typically required.
  • Performance characteristics and scalability limits of the default backend under typical workloads.
  • Whether task result persistence and retrieval work across process boundaries with the default configuration.

Package facts

License BSD-3-Clause (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 3 — Django, typing_extensions, django-stubs-ext
Maintenance actively maintained — 189 days since the last release
Last repo commit
First released
Downloads 858,580/month — #4,880 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: django_tasks-0.12.0-py3-none-any.whl

Development Status :: 5 - Production/StableEnvironment :: Web EnvironmentFramework :: DjangoFramework :: Django :: 4.2Framework :: Django :: 5.0Framework :: Django :: 5.1Framework :: Django :: 5.2Framework :: Django :: 6.0Intended Audience :: DevelopersNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: Implementation :: CPythonTopic :: Internet :: WWW/HTTPTyping :: Typed

Tags

django task queueasync task execution djangodjango background jobstask scheduling djangodjango task backendenqueue tasks djangotask result tracking
django-frameworktask-queueasync-execution

More WWW/HTTP packages