Good form: How Django’s form rendering improved during the 4.x series
summary
Django 4.x switches form rendering to the template engine, adding as_div as an accessible default and a transitional renderer to preserve older table output; templates can be set per-project, per-form and per-instance via a custom form renderer or form.render(template=...), and the new use_fieldset and legend support let choice widgets render grouped inputs with proper fieldsets. Practical examples show how to move label/helptext logic onto fields, loop bound fields to reduce template repetition, and compare when third‑party tools like crispy‑forms (Python layouts, template packs, dynamic CSS classes) still add value. Also previews boundfield as_fieldGroup landing in Django 5.0.
AI-written summary · about
chapters (8)
- 0:00Introduction
- 1:51Form anatomy basics
- 5:48Accessible form rendering
- 10:30Customizing form layout
- 14:27Reusable form templates
- 17:58Third-party libraries
- 22:34Future improvements
- 25:20Q&A
related talks
23mSolving Problems With Django Forms
46mDjango + Alpine.js + htmx Ups & Downs with Karen Tracey
45mKeynote: All The Ways To Use Django with Zags
29mPushing The Pony's Boundaries - Django Admin Customization
28mSaved you a click (or three): Supercharging the Django admin with actions and views
18mBuilding theatlantic.com homepage’s WYSIWYG admin with...
23mA different Form of navigation
27mBeyond Po: How to Make Django Work...
