hedron-django
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.55.x (in-tree tip v0.55.0; PyPI 0.54.0 deferred) · pin >=0.55.0,<0.56 in-tree (PyPI >=0.54.0,<0.55 while deferred)
Adapter capability readiness is Supported when pinned — see What’s ready.
Install
pip install "hedron-django>=0.55.0,<0.56"
# or
uv add "hedron-django>=0.55.0,<0.56"
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.54.0,<0.55" 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/respondrendering facade@hedron_viewdecorator with fragment-region policyHedronDjangoConfigsystem checksHedronSecurityHeadersMiddlewarefor portableSecurityPolicyheaders- Forms bridge and bounded QuerySet
DataSource - Job status polling helpers
Links
- Add to an existing Django project
- Adapters API
- Changelog
- Source
- Issues
- Django reference example
hedron-core·hedron·hedron-flask
License
MIT. See the repository license.
Release files for hedron-django 0.55.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| hedron_django-0.55.0.tar.gz | 22.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| hedron_django-0.55.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 47.9 kB
Release files / hedron_django-0.55.0.tar.gz
| Download URL | hedron_django-0.55.0.tar.gz |
|---|---|
| Size | 22.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
57a3768bf646acf5fab47a0b5793a79e0aa913809e1b820e430be833ec2129d0
|
|
BLAKE2b-256 checksum How to use checksums |
e37cf2b7ea2c30d489ce1e8288c998c40373c341bba483108d0abdfa0fd5abb1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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}
|
Release files / hedron_django-0.55.0-py3-none-any.whl
| Download URL | hedron_django-0.55.0-py3-none-any.whl |
|---|---|
| Size | 24.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8c47ffeb1b9ed0fa827aee94c993f194c30592290660fc3238cc25d8b5981faa
|
|
BLAKE2b-256 checksum How to use checksums |
5e75660d5a8feef56535b15abf23490c104f2f6cafb220841ae3da6d034ab3a2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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}
|