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.1.0

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.1.0
File Size Uploaded Provenance Actions
django_absurd-1.1.0.tar.gz 141.9 kB With provenance Details for django_absurd-1.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 304.3 kB

Release files / django_absurd-1.1.0.tar.gz

Download URL django_absurd-1.1.0.tar.gz
Size 141.9 kB
Tags Source
SHA-256 checksum
How to use checksums
11fa68efdf8a3a16b9a536e266d23278bde868dc8d6bb6b0cce592ae712c7ea3
BLAKE2b-256 checksum
How to use checksums
73a0996d7644cca7dcd69c465c3ace0de6ecf10ad8d2cd178f8faf81285bf8e7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 16, 2026.

Transparency log

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

Download URL django_absurd-1.1.0-py3-none-any.whl
Size 162.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a458c47c73d0488dfc62280e322d058a232358416cc681b6e560dbc8eaa0f2b0
BLAKE2b-256 checksum
How to use checksums
4029338a00cc2b3b9e8f76b57b10484aea10fe183a7d98b2e7715fd8749acfd6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 16, 2026.

Transparency log

Security for django-absurd 1.1.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for django_absurd-1.1.0.tar.gz

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 Nov 16, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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