Skip to content

lincolnloop/django-tasks-local

Repository files navigation

django-tasks-local

Zero-infrastructure task backends for Django 6.

Django 6 ships with ImmediateBackend (blocks the request) and DummyBackend (does nothing). This package provides background execution with zero infrastructure:

  • ThreadPoolBackend - I/O-bound tasks (emails, API calls, database)
  • ProcessPoolBackend - CPU-bound tasks (image processing, data analysis)

No Redis, Celery, or database required.

Installation

pip install django-tasks-local

Quick Start

# settings.py
TASKS = {
    "default": {"BACKEND": "django_tasks_local.ThreadPoolBackend"},
}
from django.tasks import task

@task
def send_welcome_email(user_id):
    ...

send_welcome_email.enqueue(user.id)

Documentation

Limitations

  • In-memory only - Results lost on restart
  • No scheduling - supports_defer = False
  • No priority - FIFO execution

For persistence, see django-tasks which provides DatabaseBackend and RQBackend.