Skip to main content

hedron-django

PyPI Python CI License: MIT

Django adapter for Hedron component rendering and HTMX interactions.

Render components as HttpResponse, map portable InteractionResult values, reverse URLs via Django’s resolver, and integrate CSRF/session through native middleware. Shares the hedron-core renderer with FastAPI and Flask. Does not install FastAPI.

Also ships a first-party bounded QuerySet DataSource and Django forms bridge — supply an already-authorized base QuerySet; omitted sort/filter allowlists deny client refinements.

Package maturity: Beta · Train: 0.25.x (last published 0.25.1; workspace 0.25.2 candidate) · pin >=0.25.0,<0.26

Adapter capability readiness is Supported when pinned — see What’s ready.

Install

pip install "hedron-django>=0.25.0,<0.26"
# or
uv add "hedron-django>=0.25.0,<0.26"

Requires Python 3.11–3.14, hedron-core, and Django >=5.2,<6.

Install the AppConfig for system checks:

INSTALLED_APPS = [
    # ...
    "hedron_django.apps.HedronDjangoConfig",
]

Scaffold a new Django project:

uvx --from "hedron>=0.25.0,<0.26" hedron new --django my-django-app

Quick start

from django.http import HttpRequest
from hedron_core import Heading, Page, Text
from hedron_django import HedronDjango, hedron_view

hedron = HedronDjango()


@hedron_view
def home(request: HttpRequest):
    return hedron.respond(
        Page(
            Heading("Hello Django", level=1),
            Text("Native Django URLconf with Hedron components."),
            title="Home",
        ),
        request,
    )

Wire the view into your URLconf as usual. For HTMX fragments, declare fragment_regions on @hedron_view and return an InteractionResult.

What this package includes

  • HedronDjango / respond rendering facade
  • @hedron_view decorator with fragment-region policy
  • HedronDjangoConfig system checks
  • HedronSecurityHeadersMiddleware for portable SecurityPolicy headers
  • Forms bridge and bounded QuerySet DataSource
  • Job status polling helpers

Links

License

MIT. See LICENSE.

Download files

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

Source Distribution

hedron_django-0.25.2.tar.gz (16.8 kB view details)

Uploaded Source

Built Distribution

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

hedron_django-0.25.2-py3-none-any.whl (20.2 kB view details)

Uploaded Python 3

File details

Details for the file hedron_django-0.25.2.tar.gz.

File metadata

  • Download URL: hedron_django-0.25.2.tar.gz
  • Upload date:
  • Size: 16.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for hedron_django-0.25.2.tar.gz
Algorithm Hash digest
SHA256 3d2b91b076a6d39110550590bb08b7e8d4173daa4f25ac0c4690eff426eda9dd
MD5 8d3a48f726ec4d4e9d0e0e3b76c95e04
BLAKE2b-256 4fb7857520df98fb07548f4b602d9241fb1b85bc162c7bd6ef1e2069ae3e2c3c

See more details on using hashes here.

File details

Details for the file hedron_django-0.25.2-py3-none-any.whl.

File metadata

  • Download URL: hedron_django-0.25.2-py3-none-any.whl
  • Upload date:
  • Size: 20.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for hedron_django-0.25.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1c831ded76ccd163839cedec8ac32b19ec46eaae8d1f2c2733ff035e4689b024
MD5 409e27813327433d1592782ef6a0c644
BLAKE2b-256 2c3a092fd2a4966c68a1634aaecc9164bcdc2d6f86372fa226b221038557c1a2

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 Sentry Error logging StatusPage Status page