Skip to content

django-absurd — ceci n'est pas une queue

django-absurd

Run background tasks in Django on Postgres — no separate broker, no Redis, no Celery. It plugs Absurd, a Postgres-native workflow engine, into Django's built-in Tasks framework and reuses your existing database connection.

Alpha

APIs and behavior may change between releases.

Requirements

  • Python 3.12+, Django 6.0+
  • PostgreSQL with the psycopg (v3) driver (django.db.backends.postgresql). Absurd reuses Django's connection — psycopg2 won't work.

Install

django-absurd is in alpha — only pre-releases are published, so your installer must be allowed to pick them up.

uv add django-absurd --prerelease allow

Using pip:

pip install --pre django-absurd

Quickstart

1. Add the app and point Django's TASKS setting at the backend:

settings.py
INSTALLED_APPS = [
    # ...
    "django_absurd",
]

TASKS = {
    "default": {
        "BACKEND": "django_absurd.backends.AbsurdBackend",
    },
}

2. Migrate. This installs Absurd's schema and provisions your declared queues:

python manage.py migrate

3. Write a task with Django's @task decorator — anywhere importable:

from django.tasks import task


@task
def add(a: int, b: int) -> int:
    return a + b

4. Enqueue it. Returns a TaskResult; a worker runs it:

result = add.enqueue(2, 3)

5. Run a worker:

python manage.py absurd_worker

That's the whole loop. The task runs on the worker, and the result is stored in Postgres — fetch it later with add.get_result(result.id).

Next

  • Tasks — enqueue with retries and other options, and read results.
  • Configuration — every setting, in one place.
  • How it works — how queues, runs, checkpoints, and the admin fit together, with links to the Absurd and Django docs.