Build your first Edron app¶
This path takes about five minutes with Python 3.11–3.14 and
uv. Node.js is not required.
1.3 is published
Hedron 1.3.0 is available from PyPI. The documentation describes the stable Hedron 1.3 API contract.
1. Scaffold and run¶
uvx --from "edron>=1.0.0" edron new my-app --template minimal
cd my-app
uv sync
uv run edron run app:app --reload
Open http://127.0.0.1:8000. The generated project is an
ordinary ASGI application and can also run with uv run uvicorn app:app --reload.
2. Understand the page¶
The generated app.py follows this shape:
import edron as ed
app = ed.App(title="Sales", security="standard")
@app.page("/", title="Sales dashboard")
class Home(ed.Page):
def render(self) -> None:
self.metric("Orders", 128, delta="+12")
self.text("A useful page rendered entirely on the server.")
App owns the native application and registrations. A fresh Page instance handles each
request. Calls such as metric() and text() append components to that request's page tree;
the page instance is not durable user state.
Change 128 to 129, save the file, and refresh the browser.
3. Add a bounded interaction¶
Add these methods inside Home:
@ed.fragment
def status(self) -> None:
self.text("All systems operational")
@ed.action
def refresh_status(self) -> ed.Outcome:
return ed.refresh(self.status)
Then call them from render():
The button posts to a declared action. The outcome refreshes only the registered fragment, while Edron preserves Hedron's CSRF and target policies.
4. Verify the application¶
check is static and does not execute the application. explain and doctor import only
source you trust.
If something fails¶
| Symptom | Fix |
|---|---|
| No matching Edron distribution | Confirm the version and index in Installation |
edron: command not found |
Use uv run edron or python -m edron in the project environment |
| Reload requires an import target | Use app:app, not a bare .py filename, with --reload |
| Port 8000 is busy | Add --port 8001 and open that port |
| A POST returns 403 | Load the page first, then review the security profile and CSRF guidance |