Skip to main content
DjanQuiltDB

djanquiltdb-plugin-celery

PyPI Supported Python versions Supported Django versions Supported PostgreSQL versions CI Documentation Coverage BSD-3-Clause licence

DjanQuiltDB shards a database across schemas and nodes. This library provides Celery tasks that run in the shard that they are sent to, and that are retried while that shard is in maintenance:

from djanquiltdb.decorators.celery import shared_task_for_shard


@shared_task_for_shard
def send_invoice(invoice_id):
    Invoice.objects.get(pk=invoice_id).send()


send_invoice.for_shard(shard).delay(invoice_id=12)
send_invoice.delay(invoice_id=12, tenant_slug='acme')

The shared_task_for_* decorators create a shared task, as celery.shared_task() does. The task_for_* methods of a QuiltCelery app create a task of that app, as app.task() does. Set up the app as Celery’s documentation for Django describes, with QuiltCelery in place of Celery:

# myproject/celery.py
from djanquiltdb.base.celery import QuiltCelery

app = QuiltCelery('myproject')
app.config_from_object('django.conf:settings', namespace='CELERY')
app.autodiscover_tasks()

# myapp/tasks.py
from myproject.celery import app


@app.task_for_shard
def send_reminder(invoice_id):
    Invoice.objects.get(pk=invoice_id).send_reminder()

A task that is decorated with shared_task_for_node runs in the public schema of the node that its node_name identifies. A task that is decorated with shared_task_for_active_shard runs in the shard that is active where the task is sent. A task that is decorated with shared_task_for_every_shard runs once in every active shard when it is sent without a shard:

from djanquiltdb.decorators.celery import shared_task_for_every_shard


@shared_task_for_every_shard(queue='fanout', spread=(0, 300))
def clean_up_drafts():
    Draft.objects.filter(updated_at__lt=a_month_ago()).delete()


clean_up_drafts.delay()

Install the plugin through the celery extra of DjanQuiltDB:

pip install djanquiltdb[celery]

The installation guide describes the setup in full, and the optional QUILT_CELERY setting.

Full documentation is at https://djanquiltdb.readthedocs.io/en/latest/plugins/celery/index.html.

Development

This package is developed in the DjanQuiltDB repository beside djanquiltdb itself. Tests run through tox against the Postgres containers in the repository’s docker-compose.yml; see DOCKER.md at the repository root:

docker compose run --rm test tox

Requirements

  • Python 3.12 to 3.15

  • Django 5.2, 6.0 or 6.1

  • PostgreSQL 17 or 18

  • djanquiltdb 4.5.0 or newer 4.x

  • Celery 5.6 or newer 5.x

Metadata

Release files for djanquiltdb-plugin-celery 1.2.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 djanquiltdb-plugin-celery 1.2.0
File Size Uploaded Provenance Actions
djanquiltdb_plugin_celery-1.2.0.tar.gz 58.4 kB With provenance Details for djanquiltdb_plugin_celery-1.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for djanquiltdb-plugin-celery 1.2.0
File Interpreter ABI Platform Actions
djanquiltdb_plugin_celery-1.2.0-py3-none-any.whl Python 3 none any Details for djanquiltdb_plugin_celery-1.2.0-py3-none-any.whl

Total release size: 85.5 kB

Release files / djanquiltdb_plugin_celery-1.2.0.tar.gz

Download URL djanquiltdb_plugin_celery-1.2.0.tar.gz
Size 58.4 kB
Tags Source
SHA-256 checksum
How to use checksums
7f5b6c4a8828840b3982827518f25e2c692b7275d59015ccaaeec60cc61776aa
BLAKE2b-256 checksum
How to use checksums
792474c69c822772b1ad8b0f78ae84029923b1c1f469a418902749bd0b9c544c
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 12, 2026.

Transparency log

Release files / djanquiltdb_plugin_celery-1.2.0-py3-none-any.whl

Download URL djanquiltdb_plugin_celery-1.2.0-py3-none-any.whl
Size 27.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a404f5177c91af6e4671a6c360f8f99af43ea745ace583ccd2d69dd989ebe88e
BLAKE2b-256 checksum
How to use checksums
fd78ed934d59d769808a016fb02d14cc50221d410de3af01a2a6601feb981ad1
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 12, 2026.

Transparency log

Security for djanquiltdb-plugin-celery 1.2.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 djanquiltdb_plugin_celery-1.2.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 12, 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