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 4.2+ with no adapter upper cap
  • Python 3.11+; choose a Python/Django combination supported by that Django release

Existing Django 4.2 and 5.2 applications can install the adapter without moving to Django 6. Current-framework tests also cover Django 6.1.1. The Celery/all-extras combination respects django-celery-beat's own Django<6.1 constraint.

This range describes integration API compatibility. Use supported Django release lines and current security patches for production; legacy compatibility does not certify an older host application as secure. Z4J's own audited deployment locks are maintained separately from the adapter's public requirements.

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://docs.z4j.com/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 docs.z4j.com/frameworks/django/.

License

Apache-2.0, see LICENSE.

Metadata

Release files for z4j-django 1.12.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 z4j-django 1.12.0
File Size Uploaded
z4j_django-1.12.0.tar.gz 43.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for z4j-django 1.12.0
File Interpreter ABI Platform
z4j_django-1.12.0-py3-none-any.whl Python 3 none any Details

Total release size: 85.3 kB

Release files / z4j_django-1.12.0.tar.gz

Download URL z4j_django-1.12.0.tar.gz
Size 43.8 kB
Tags Source
SHA-256 checksum
How to use checksums
e0cae3f35b360a901a85dccda0e7ea28cf9de58369fbc4ddd6d5940ff642fa11
BLAKE2b-256 checksum
How to use checksums
ef440979da82baba1edb88fc16458a3c50b306c8b1affecfe3f8a6bce5edce05
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / z4j_django-1.12.0-py3-none-any.whl

Download URL z4j_django-1.12.0-py3-none-any.whl
Size 41.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8cd045bc9b5b93a32898ff592f3e97f9523d2761780990f36afec91bfc7d3010
BLAKE2b-256 checksum
How to use checksums
83e94a5fc4ef85226e26034538c9b7bbcd7d3c600f436ab248ea4acc3363d7dd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release history Release notifications | RSS feed

This release

1.12.0 This release

2 release files

1.11.0

2 release files

1.10.0

2 release files

1.9.1

2 release files

1.9.0

2 release files

1.8.0

2 release files

1.7.0

2 release files

1.6.9

2 release files

1.6.8

2 release files

1.6.7

2 release files

1.6.0

2 release files

1.5.0

2 release files

1.4.0

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.2

2 release files

1.1.0

2 release files

1.0.7

2 release files

1.0.6

1 release file

1.0.5

2 release files

1.0.4

2 release files

1.0.1

2 release files

1.0.0

2 release 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