Django forms in the age of HTMx: the single field form
summary
Shows how HTMx makes any element behave like a single-field form and how Django forms still provide validation and rendering when you skip a form tag. Demonstrates concrete patterns: a widget mixin that injects request and AJAX context for widget templates, a plugin registry to register/unregister field-type subclasses, and storing field answers in JSON or models. Presents a working migration: Argus converted from React to HTMx (production service, Django 5.2, Tailwind, DaisyUI) and two live demos.
AI-written summary · about
chapters (17)
- 0:00Introduction to talk
- 1:31Horror stories of old forms
- 4:06Birth of single field form
- 5:51Single field form basics
- 7:38Demo old style form
- 9:08Adding HTMX to forms
- 11:01Single field form benefits
- 12:41Code walkthrough
- 13:58Magic of single field forms
- 15:02HTMX widget context
- 15:43Creating plugins easily
- 16:45Registry and unregistering
- 17:26Q&A begins
- 17:50Question about form explosion
- 20:00HTMX app structure
- 21:43Permissions and security
- 23:08Closing remarks
