Skip to main content

z4j Django framework adapter (Apache 2.0)

Project description

z4j-django

PyPI version Python License

License: Apache 2.0 Status: v1.0.0 - first public release.

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

pip install z4j-django z4j-celery z4j-celerybeat

Pick the engine adapter(s) that match your stack:

pip install z4j-django z4j-rq z4j-rqscheduler
pip install z4j-django z4j-dramatiq z4j-apscheduler
pip install z4j-django z4j-huey z4j-hueyperiodic

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.4.tar.gz (33.6 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.4-py3-none-any.whl (29.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: z4j_django-1.0.4.tar.gz
  • Upload date:
  • Size: 33.6 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.4.tar.gz
Algorithm Hash digest
SHA256 1b1a22778294db3ee4ea0e02fe2cdc10ed0e955c5bd6dc21708b795731413b51
MD5 d9d5ceebaab45c79461c4f5713221211
BLAKE2b-256 f69c2b2a7dae8e9b77e26a5115e86fda07f3e02e2198751e8a9033b68ef3029a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: z4j_django-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 29.9 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 0e07dd9ae9711c9ed0e15e2693f27bf4726d2f2c066d76728dbd3d1c149bc6de
MD5 a520b72bc62355c83a958b5c3385fa20
BLAKE2b-256 fc5978f4843fe964c70a8c453cec0a1a624f2e50b50e9c88de049816bd7dd6be

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