Skip to main content

django-absurd

CI Coverage PyPI Python versions Django versions License

Run background tasks and durable workflows in Django on Postgres. Plugs Absurd, a Postgres-native workflow engine, into Django's Tasks framework, reusing the database connection your project already has.

Install

uv add django-absurd
pip install django-absurd

Needs Python 3.12+, Django 6.0+, and PostgreSQL on the psycopg (v3) driver — Absurd reuses Django's connection, so psycopg2 won't work.

Quickstart

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

TASKS = {
    "default": {
        "BACKEND": "django_absurd.backends.AbsurdBackend",
    },
}
# Installs the Absurd schema and provisions the queues you declared.
python manage.py migrate
from django.tasks import task


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


# Returns a TaskResult straight away; a worker runs the task.
result = add.enqueue(2, 3)
python manage.py absurd_worker

That's the whole loop. The "default" queue is declared for you, so migrate provisions it without any QUEUES setting of your own.

Wrap work in steps and a retry resumes instead of redoing:

from django_absurd import get_absurd_context


@task
def pay_for_order(order_id: int, amount: int) -> None:
    # Absurd's workflow context — steps, sleep, events.
    context = get_absurd_context()

    def process_payment():
        return stripe.charges.create(amount=amount)

    # Checkpointed under "process-payment": Absurd stores the result.
    charge = context.step("process-payment", process_payment)
    # If this raises, the retry replays the task but reuses the charge above.
    context.step("send-receipt", lambda: send_receipt(order_id, charge))

Documentation

  • Documentation — tasks, workflows, cron jobs, workers, cleanup, monitoring, testing, and configuration.
  • Runnable examples — three dockerized nanodjango demos (web enqueue+result, beat, and pg_cron), each with one docker compose up.

License

MIT — see LICENSE.

Metadata

Release files for django-absurd 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-absurd 1.0.1
File Size Uploaded
django_absurd-1.0.1.tar.gz 139.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-absurd 1.0.1
File Interpreter ABI Platform
django_absurd-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 298.2 kB

Release files / django_absurd-1.0.1.tar.gz

Download URL django_absurd-1.0.1.tar.gz
Size 139.2 kB
Tags Source
SHA-256 checksum
How to use checksums
b5d36c327a649348e2f8183f881eb05c2232bdbdbdca97eb83ad3a5de294dc2b
BLAKE2b-256 checksum
How to use checksums
6efb580455aea8ccc72a3dc8090795ac183194bb8b3e019b2d2338b6f7f5eb96
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 11, 2026.

Transparency log

Release files / django_absurd-1.0.1-py3-none-any.whl

Download URL django_absurd-1.0.1-py3-none-any.whl
Size 159.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
17d4d3189f4006f9df47d805b828b4c79d7b853ef9e64e3a80264d7e5d10c248
BLAKE2b-256 checksum
How to use checksums
45787f9bd547f15e7a7fd50cc4d600224a3f0985d73cc41f25a8ef885a3770cc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 11, 2026.

Transparency log
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page