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.20.0 (Published) · pin >=0.20.0,<0.21
Adapter capability readiness is Supported when pinned — see What’s ready.
Install
pip install "hedron-django>=0.20.0,<0.21"
# or
uv add "hedron-django>=0.20.0,<0.21"
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.20.0,<0.21" 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 LICENSE.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hedron_django-0.20.0.tar.gz.
File metadata
- Download URL: hedron_django-0.20.0.tar.gz
- Upload date:
- Size: 13.4 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e0ae37007a65bde9a6a50804032b31f2ae0893a2e433f4d44e452d9fe13cfae0
|
|
| MD5 |
0a15240323c88e849bea7c7e0d4c9935
|
|
| BLAKE2b-256 |
8872df8bd3716d7e817b573ccb559ca9846cd12ffc5eb8f31fc234b73a4d30e0
|
File details
Details for the file hedron_django-0.20.0-py3-none-any.whl.
File metadata
- Download URL: hedron_django-0.20.0-py3-none-any.whl
- Upload date:
- Size: 16.8 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f9c190a842033339e49c495c46e5e05660014512548aa527b0a0a2e2b150a805
|
|
| MD5 |
6e6c9178d89e4c1d2ce398169a3b2003
|
|
| BLAKE2b-256 |
0457aad282f4df82b269b504bad109fd82d2fd3b1cbb64f7687ca0b16543fa11
|