Metadata-Version: 2.4
Name: django-absurd
Version: 0.1.0a6
Summary: Django integration for Absurd, the Postgres-native workflow engine.
Project-URL: Documentation, https://lincolnloop.github.io/django-absurd/
Project-URL: Homepage, https://github.com/lincolnloop/django-absurd
Project-URL: Issues, https://github.com/lincolnloop/django-absurd/issues
Project-URL: Repository, https://github.com/lincolnloop/django-absurd
Author-email: Marc Gibbons <marc@lincolnloop.com>, Lincoln Loop <info@lincolnloop.com>
License-Expression: MIT
License-File: LICENSE
Keywords: absurd,background-jobs,django,postgres,queue,tasks,workflow,workflow-engine
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Framework :: Django :: 6.0
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: System :: Distributed Computing
Classifier: Typing :: Typed
Requires-Python: >=3.12
Requires-Dist: absurd-sdk<0.6.0,>=0.5.0
Requires-Dist: croniter>=6.0
Requires-Dist: django>=6.0
Description-Content-Type: text/markdown

# django-absurd

Run background tasks in Django on **Postgres** — no separate broker, no Redis, no
Celery. Plugs [Absurd](https://earendil-works.github.io/absurd/), a Postgres-native
workflow engine, into Django's
[Tasks](https://docs.djangoproject.com/en/6.0/topics/tasks/) framework, reusing your
existing database connection.

> **Alpha.** APIs and behavior may change between releases.

## Install

```console
uv add django-absurd --prerelease allow    # or: pip install --pre django-absurd
```

Only pre-releases are published during alpha, hence the flags. 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

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

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

```console
python manage.py migrate    # installs the Absurd schema, provisions declared queues
```

```python
from django.tasks import task


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


result = add.enqueue(2, 3)   # returns a TaskResult; a worker runs it
```

```console
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.

## Documentation

- **[Documentation](https://lincolnloop.github.io/django-absurd/)** — tasks, workflows,
  cron jobs, workers, cleanup, monitoring, testing, and configuration.
- **[Runnable examples](examples/)** — three dockerized nanodjango demos (`web`
  enqueue+result, `beat`, and `pg_cron`), each with one `docker compose up`.

## License

MIT — see [LICENSE](LICENSE).
