DjangoCon US 2024: An Opinionated Guide to Modern Django Forms with Josh Thomas

Channel:
Subscribers:
42,400
Published on ● Video Link: https://www.youtube.com/watch?v=1f11t24dA-k



Duration: 0:00
88 views
0


Django forms have experienced a significant renaissance within the Django community, after years of being what felt like an afterthought. Recent releases to Django have brought major improvements to built-in form templating and rendering. Instead of writing APIs to support forms rendered by the JS framework of the week, you can now use Django forms to render dynamic, interactive, responsive forms using only the batteries provided by Django, various third-party Django packages, and a handful of small, focused JavaScript utility libraries. And if you're willing to do a little bit of the leg work yourself, you can even get by without those third-party Django packages.

In recent years, web development has started to see a shift away from complex JavaScript-heavy architectures toward more streamlined, HTML-centric approaches. Technologies like HTMX and Unpoly.js enable SPA-like experiences through server-rendered HTML, pairing nicely with Djangoโ€™s template language. Similarly, libraries like Alpine.js and Stimulus enhance static HTML with dynamic behaviors inline, eliminating the need for comprehensive frameworks. Additionally, CSS frameworks like Tailwind CSS adopt a utility-first approach, simplifying the creation of maintainable CSS.

This shift towards an HTML-centric approach to building web applications is complemented nicely by the recent improvements to Django forms. By leveraging these new capabilities, Django forms can now be used to render forms that are more easily maintainable, more responsive, more accessible, and -- to the end user -- just as interactive as one built using one of the many JS frameworks.

By the end of this talk, attendees will have a deeper understanding of the power and potential of Django forms, equipped with the knowledge to implement them effectively in their projects.

Outline
Introduction to Django forms, including a quick historical overview of where they have come
Exploration of a few new Django form features: template-based form rendering and as_field_group
Styling forms, fields, and errors using modern CSS features, with a focus on Tailwind CSS
Dynamic behavior with minimal JavaScript, with a focus on Alpine.js
Inline validation using AJAX, with a focus on HTMX
Useful third-party Django form packages and why you may not need them anymore
Hands-on demonstration of a simple form using all of the above
This talk will be suitable for anyone who has a basic understanding of Django.


This talk was presented at: https://2024.djangocon.us/talks/an-op...

LINKS:
Follow Josh Thomas ๐Ÿ‘‡
On Mastodon: https://joshthomas.dev/@josh
Website: https://joshthomas.dev/

Follow DjangoCon US ๐Ÿ‘‡
https://fosstodon.org/@djangocon
https://x.com/djangocon

Follow DEFNA ๐Ÿ‘‡
https://www.defna.org/


Video Production by Confreaks
Follow Confreaks ๐Ÿ‘‡
https://confreaks.com/
https://x.com/confreaks
https://confreaks.bsky.social/




Other Videos By Confreaks


2025-03-21DjangoCon US 2024: Lessons from E2E Testing Web Applications with Avindra Fernando
2025-03-20DjangoCon US 2024: Optimizing remote work: Pull Requests, Stand-ups, and emojis with Kasey Kelly
2025-03-20DjangoCon US 2024: Pygoat - Learn django security the hard way with Adarsh Divakaran
2025-03-19DjangoCon US 2024: Maps with Django with Paolo Melchiorre
2025-03-19DjangoCon US 2024: PostgreSQL Beyond Django: Strategies to Get Max Performance with รlvaro Justen
2025-03-18DjangoCon US 2024: Open-source Python tools to visualize and analyse ... with Samweli Mwakisambwe
2025-03-18DjangoCon US 2024: One Thousand and One Django Sites with Vince Salvino
2025-03-17DjangoCon US 2024: Passkeys: Your password-free future with Ryan Hiebert
2025-03-17DjangoCon US 2024: Django Ledger | Uniting Developers and Accountants for... with Miguel Sanda
2025-03-16DjangoCon US 2024: path('/user/user.username:user/', view_profile) with Willem Van Onsem
2025-03-16DjangoCon US 2024: An Opinionated Guide to Modern Django Forms with Josh Thomas
2025-03-14DjangoCon US 2024: API Maybe: Bootstrapping a Web Application circa 2024 with Carlton Gibson
2025-03-14DjangoCon US 2024: Panel Discussion: Open, friendly, and welcoming: on the... with Lacey Henschel
2025-03-13DjangoCon US 2024: Django User Model: Past, Present, and Future with Will Vincent
2025-03-13DjangoCon US 2024: A Guided Tour Through Postgres Internals with Elizabeth Garrett Christensen
2025-03-12DjangoCon US 2024: WebRTC with Django, Channels, HTMX, and coturn with Ken Whitesell
2025-03-12DjangoCon US 2024: A Brief History of Django with Frank Wiles
2025-03-12DjangoCon US 2024: Keynote - The Fellowship of the Pony with Natalia Bidart
2025-03-11DjangoCon US 2024: Fighting Homelessness with Django with Benjamin "Zags" Zagorsky
2025-03-11DjangoCon US 2024: Hidden gems of Django 5.x with Sarah Boyce
2025-03-10DjangoCon US 2024: Faster, leaner, greener: 10x lower website carbon emissions with Thibaud Colas