Skip to main content

z4j Django framework adapter (Apache 2.0)

Project description

z4j-django

PyPI version Python License

License: Apache 2.0

Django framework adapter for z4j. Drops into any Django project via INSTALLED_APPS and bootstraps a z4j agent on Django startup - no boilerplate, no signal wiring, no custom management commands.

Install

Pick your task engine and install with the matching extra. Each extra pulls the engine adapter AND its companion scheduler in one shot, so a fresh install never needs a second command.

pip install z4j-django[celery]      # Celery + celery-beat
pip install z4j-django[rq]          # RQ + rq-scheduler
pip install z4j-django[dramatiq]    # Dramatiq + APScheduler
pip install z4j-django[huey]        # Huey + huey-periodic
pip install z4j-django[arq]         # arq + arq-cron
pip install z4j-django[taskiq]      # TaskIQ + taskiq-scheduler
pip install z4j-django[all]         # every engine (CI / kitchen sink)

pip install z4j-django (no extra) installs only the framework adapter. That's useful if you already manage engine packages elsewhere; otherwise always pick an engine extra.

Configure

Add z4j_django to your installed apps and set the Z4J dict in Django settings:

# settings.py
INSTALLED_APPS = [
    # ... your apps ...
    "z4j_django",
]

Z4J = {
    "brain_url": env("Z4J_BRAIN_URL"),   # e.g. "https://z4j.internal"
    "token":     env("Z4J_TOKEN"),       # minted in the brain dashboard
    "project_id": env("Z4J_PROJECT_ID", default="default"),
}

On python manage.py runserver (or gunicorn, daphne, uvicorn, ...) the agent starts, connects to the brain, and z4j's dashboard populates with every @shared_task and @task it discovers in your INSTALLED_APPS.

What it does

Piece Purpose
Z4JDjangoConfig.ready() Boots the agent once Django is fully loaded (after INSTALLED_APPS is populated)
Five-layer task discovery Walks INSTALLED_APPS to find @shared_task / @app.task declarations
Django auth bridge Maps the signed-in Django user to z4j_core.User for audit-log stamping
django.core.checks Surfaces misconfiguration at manage.py check time
Optional admin embed Renders a read-only "z4j agent status" panel in the Django admin

Reliability

z4j-django follows the project-wide safety rule: z4j never breaks your Django process. Agent failures are caught at the boundary, logged, and swallowed. Your runserver, gunicorn, and ASGI workers are never affected by a z4j issue.

Documentation

License

Apache 2.0 - see LICENSE. Your Django application is never AGPL-tainted by importing z4j_django.

Links

Project details


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.0.7.tar.gz (37.4 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.0.7-py3-none-any.whl (33.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: z4j_django-1.0.7.tar.gz
  • Upload date:
  • Size: 37.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for z4j_django-1.0.7.tar.gz
Algorithm Hash digest
SHA256 617516a183ac9814031708675a90c0e92052c300b9f10c2b550df6252421e5a2
MD5 dc3c96b285212de476f067831c512244
BLAKE2b-256 6a9a198899a5d3f0cd410ae944b3df3c0eb45798afd3a4ba963d8472f4300d93

See more details on using hashes here.

File details

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

File metadata

  • Download URL: z4j_django-1.0.7-py3-none-any.whl
  • Upload date:
  • Size: 33.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for z4j_django-1.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 48052d2327a8f493224ff822e54078d9304c4a64b24336cf4df6b09cb157d753
MD5 bc9dcf75ed161be6804fb53fbc778d23
BLAKE2b-256 45018f301cf3f85f6287426f4e880ce1926a9ce78f5adee62785f5c7caa7ac1d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page