Django integration for Absurd, the Postgres-native workflow engine. Runs Django's Tasks framework on Postgres — no separate broker — reusing Django's own database connection.
Alpha. APIs and behavior may change between releases.
- Python 3.12+, Django 6.0+
- PostgreSQL with the psycopg (v3) Django backend (the Absurd SDK reuses Django's connection and requires psycopg3)
pip install django-absurdAdd the app and point Django's TASKS setting at the backend:
# settings.py
INSTALLED_APPS = [
# ...
"django_absurd",
]
TASKS = {
"default": {
"BACKEND": "django_absurd.backends.AbsurdBackend",
},
}python manage.py migrate # create the Absurd schema
python manage.py absurd_worker # run a worker (consumes the "default" queue)Define a task with Django's Tasks API and enqueue it — the "default" queue is
created automatically on first use:
from django.tasks import task
@task
def add(a: int, b: int) -> int:
return a + b
result = add.enqueue(2, 3) # returns a TaskResult; the worker runs it- Integration guide — full configuration and
OPTIONS, workers, task parameters, retrieving results, admin introspection, querying queue state with the ORM, deployment notes, and adopting an existing Absurd database. Includes scheduling recurring tasks (beat and pg_cron schedulers). - Runnable examples — three dockerized nanodjango demos (
webenqueue+result,beat, andpg_cron), each with onedocker compose up.
MIT — see LICENSE.