DjangoCon Europe 2026

Django forms in the age of HTMx: the single field form
2026-04-15 , AMPHITHEATRE

There are many ways to do "interesting" things with forms...

With HTMx it is possible to treat any HTML tag as a form, without using form tags. It becomes easy to alter just one field of a form: click on the field to swap out the presentation with a suitable input field, then submit that single field on pressing Enter.

What is not necessarily so easy is adapting the use of Django's forms so that they are used both for validation and rendering of that single field, and smuggling in the necessary context a form widget needs if one skips the <form>-tag and uses widget templates to render the inputs.

Incidentally it does become easy to have plugin-able forms...

This talk will briefly look at previous "interesting" (ab)uses of Django forms, followed by demonstrating some hands-on techniques and patterns for working with single fields, using a special made demonstration site and a production service that was converted in 2024-2025 from a SPA using REACT to an MPA using HTMx: Argus.

Django: https://docs.djangoproject.com/
HTMx: https://htmx.org
Live Argus demo: https://argus-demo.uninett.no/
Argus code: https://github.com/Uninett/Argus
Code for singlefield demo: https://github.com/Uninett/singlefieldform
Slides: https://github.com/Uninett/singlefieldform/tree/main/slides


Topics:

Django Internals, HTML/CSS/JavaScript, Forms, htmx

Audience Level:

Intermediate

I used to call myself a dual-class sysadmin/developer but lately (+10 years) it's mostly been dev, and mostly backend. Been dabbling with Python since 1.5, and side-eyeing Django forms since 2008. I work for Norway's NREN (basically, the academic internet backbone), Sikt, in a team that open sources All! its! things!