django-tasks
A backport of Django's built in Tasks framework
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-tasksuv
uv add django-taskspoetry
poetry add django-tasksInstalling 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
Tags
More WWW/HTTP packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
h11h11 is a pure-Python HTTP/1.1 protocol…
permissive · top 100 on PyPI
httpxHTTPX is a fully featured HTTP client library…
permissive · top 100 on PyPI
httpcoreA minimal low-level HTTP client library that…
permissive · top 100 on PyPI
aiohttpaiohttp is an async HTTP client and server…
permissive · top 100 on PyPI
django-tasks-dbA Django Tasks backend that stores and executes…
permissive · top 15,000 on PyPI
django-rqDjango-RQ integrates RQ (Redis Queue) with…
permissive · top 5,000 on PyPI
django-q2Django Q2 is a multiprocessing distributed task…
permissive · top 15,000 on PyPI
django-dramatiqIntegrates Dramatiq, a distributed task queue,…
unclear · top 15,000 on PyPI
django-background-tasksDjango Background Tasks is a database-backed…
permissive · top 15,000 on PyPI
pgqueuerPgQueuer turns PostgreSQL into a background job…
permissive · top 15,000 on PyPI
dvc-taskdvc-task queues and runs background jobs from…
permissive · top 5,000 on PyPI
gcloud-rest-taskqueueAsyncio and threadsafe Python client for Google…
permissive · top 15,000 on PyPI
aa-taskmonitorA Django admin plugin for Alliance Auth that…
permissive · top 15,000 on PyPI