Architecture¶
Design constraints¶
Django forms render at three levels:
- Form (
{{ form }}) — all fields with labels, errors, help text. - Field (
{{ field.as_field_group }}) — one field with label, errors, help text. - Widget (
{{ field }}) — just the bare<input>,<select>, etc.
Django admin only renders at the widget level. This means:
- Overriding form or field level rendering is admin-safe.
- Widget template overrides must be admin-compatible.
- CSS is independent — admin and frontend load separate stylesheets.
- CSS styles all form elements globally — standalone inputs get
DaisyUI styling without needing
{{ form }}. - CSS must be easily overridable — use
@layer componentsso users can override with utility classes or unlayered CSS.