Skip to content

lincolnloop/django-absurd

Repository files navigation

django-absurd

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.

Requirements

  • Python 3.12+, Django 6.0+
  • PostgreSQL with the psycopg (v3) Django backend (the Absurd SDK reuses Django's connection and requires psycopg3)

Install

pip install django-absurd

Quickstart

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",
    },
}
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

Documentation

  • Integration guide — full configuration and OPTIONS, workers, task parameters, retrieving results, deployment notes, and adopting an existing Absurd database.
  • Runnable example — a dockerized Django project demonstrating the whole flow end to end.

License

MIT — see LICENSE.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors