Skip to main content

z4j-django

PyPI version Python License

The Django framework adapter for z4j.

Adds the z4j agent to a Django process as a single INSTALLED_APPS entry. The Django integration locates a configured Celery app when z4j-celery is installed, and z4j-celery separately bootstraps the agent in Celery worker processes. Installing an RQ, Dramatiq, Huey, arq, or TaskIQ adapter does not by itself activate that engine in Django; wire those worker processes through the engine-specific or framework-free integration.

Compatibility

  • Django 5.2.17 or newer (below Django 6) on Python 3.11
  • Django 6.0.8 or newer with no adapter cap on Python 3.12+
  • Python 3.11+

A standalone Python 3.12+ install can resolve Django 6.1. The Celery and all-extras lanes currently resolve Django 6.0.8 because django-celery-beat still declares Django<6.1; that is an upstream coexistence constraint, not a stale security pin.

Pair with an engine adapter (z4j-celery, z4j-rq, z4j-dramatiq, z4j-huey, z4j-arq, z4j-taskiq); each engine adapter carries its own upstream floor.

Full per-adapter matrix at https://z4j.dev/reference/compatibility/.

What it ships

  • One-line install, add "z4j_django" to INSTALLED_APPS; the agent starts when Django boots, no decorator on every task
  • Celery discovery and worker bootstrap, locates the configured Celery app in Django processes and registers a separate engine-aware runtime inside Celery workers
  • Schedule integration, pair with z4j-celerybeat to surface django-celery-beat schedules on the dashboard's Schedules page
  • Per-task metadata from supporting engine adapters; z4j-celery, z4j-rq, and z4j-dramatiq expose @z4j_meta rather than this framework package defining one
  • Service-user safe, auto-relocates the local outbound buffer to $TMPDIR/z4j-{uid} when $HOME is unwritable (gunicorn under www-data, nginx, etc.)

Install

pip install z4j-django z4j-celery z4j-celerybeat

Then in settings.py:

INSTALLED_APPS = [
    # ...
    "django_celery_beat",  # if you use celery-beat
    "z4j_django",
]

The agent reads its bearer token from Z4J_TOKEN, mandatory envelope-signing secret from Z4J_HMAC_SECRET, z4j URL from Z4J_BRAIN_URL, and project id from Z4J_PROJECT_ID. The Agents page shows the token and HMAC secret when the agent is minted; retain both values.

Reliability

  • Agent startup and delivery failures are logged and isolated from Django request handlers, signals, and worker code; capture hooks make no brain network request inline.
  • Engine event queues and the SQLite outbound buffer are bounded. Queue overflow drops new events and buffer pressure evicts oldest rows; both losses are logged.
  • Agent reconnects on every transient failure with bounded backoff.

Documentation

Full docs at z4j.dev/frameworks/django/.

License

Apache-2.0, see LICENSE.

Links

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

z4j_django-1.9.1.tar.gz (43.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

z4j_django-1.9.1-py3-none-any.whl (41.4 kB view details)

Uploaded Python 3

File details

Details for the file z4j_django-1.9.1.tar.gz.

File metadata

  • Download URL: z4j_django-1.9.1.tar.gz
  • Upload date:
  • Size: 43.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.7

File hashes

Hashes for z4j_django-1.9.1.tar.gz
Algorithm Hash digest
SHA256 a01474eea6d6fe2f2088b0fac2062d0ed83212a27b883f6d0f03215977f6edad
MD5 de4b55010afc0336a9a9658a8b068052
BLAKE2b-256 5e0af3d330000f9a8ad563ec72979172975823c9b36e3d859ec321d921c24f42

See more details on using hashes here.

File details

Details for the file z4j_django-1.9.1-py3-none-any.whl.

File metadata

  • Download URL: z4j_django-1.9.1-py3-none-any.whl
  • Upload date:
  • Size: 41.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.7

File hashes

Hashes for z4j_django-1.9.1-py3-none-any.whl
Algorithm Hash digest
SHA256 dcb0914441dba975da64be930448ee750732338b486377d203b9f9f57f69bf6b
MD5 c90517ac39dec5cd1581a83ca98c6769
BLAKE2b-256 63004c315d32c7621dfcfff0e5b0a25e3d61a9b769af4e0fca17b8804f1d8323

See more details on using hashes here.

Release history Release notifications | RSS feed

1.10.0

2 files

This release

1.9.1 This release

2 files

1.9.0

2 files

1.8.0

2 files

1.7.0

2 files

1.6.9

2 files

1.6.8

2 files

1.6.7

2 files

1.6.0

2 files

1.5.0

2 files

1.4.0

2 files

1.3.0

2 files

1.2.0

2 files

1.1.2

2 files

1.1.0

2 files

1.0.7

2 files

1.0.6

1 file

1.0.5

2 files

1.0.4

2 files

1.0.1

2 files

1.0.0

2 files

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