--- id: django-tasks version: "0.12.0" license: BSD-3-Clause license_treatment: permissive maintenance: active --- # django-tasks — A backport of Django's built in Tasks framework License: permissive · Maintenance: active · Downloads: 858.6K/mo ## 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 above — 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 pip install django-tasks uv add django-tasks 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_current - Install friction: low - Maintenance: active - Downloads: 858.6K/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags django task queue, async task execution django, django background jobs, task scheduling django, django task backend, enqueue tasks django, task result tracking, django-framework, task-queue, async-execution [View on SkillFed](https://skillfed.io/packages/django-tasks) · [View on PyPI](https://pypi.org/project/django-tasks/)