Create a Django form (using HTMX) in 90 seconds 🐎

Tom Dekan August 9, 2023
Video Thumbnail

Tom Dekan

View Channel

About

No channel description available.

Video Description

Hi fellow Django-ers. Here's how to create an async Django form with HTMX in 90 seconds (or less) 🐎 The post that I'm using: https://www.photondesigner.com/articles/submit-async-django-form-with-htmx?ref=yt-z67XaHvYexY The key reason why HTMX is so good in most situations is regarding expression. HTMX allows you to use javascript by adding html tags, like `hx-post`, without actually writing any javascript yourself. This is a major benefit because: - You write much less code (I only added 16 characters to provide full async functionality with HTMX). This makes it faster to build frontend, both in terms of code written and having less complexity (and bugs) - It is backend focused, making your code easier to test. By this, I mean that HTMX focuses on returning HTML from your views. You can test this simply with your standard python unit tests. You don't need to install a dedicated javascript testing framework (e.g., Vitest), or use an end-to-end test runner (e.g., Cypress). Let me know if you've any other questions 👍

You May Also Like

Craft Essential Starter Kit

AI-recommended products based on this video

Loading...
Glass Oil Sprayer for Cooking, 180ml Olive Oil Sprayer Bottle with Brush, Olive Oil Spray Mister, Kitchen Gadgets Accessories for Air Fryer, Canola Oil Spritzer (GREY)

Glass Oil Sprayer for Cooking, 180ml Olive Oil Sprayer Bottle with Brush, Olive Oil Spray Mister, Kitchen Gadgets Accessories for Air Fryer, Canola Oil Spritzer (GREY)

(2,436)
$7.99
FREE delivery Mon, Jun 16 on your first order
Loading...
Gorilla Super Glue Gel, Fast-Setting, Thick Formula with Anti-Clog Cap, Clear Cyanoacrylate, 0.53oz/15g, Pack of 1

Gorilla Super Glue Gel, Fast-Setting, Thick Formula with Anti-Clog Cap, Clear Cyanoacrylate, 0.53oz/15g, Pack of 1

(1,957)
$9.97$8.15
FREE delivery Mon, Sep 15 on your first order
5K+ bought in past month
Loading...
BRITA Metro Water Filter Pitcher 6-Cup Capacity, BPA-Free, Replaces 1,800 Plastic Water Bottles a Year, Lasts Two Months, Includes 1 Filter, Small - Pink

BRITA Metro Water Filter Pitcher 6-Cup Capacity, BPA-Free, Replaces 1,800 Plastic Water Bottles a Year, Lasts Two Months, Includes 1 Filter, Small - Pink

(170)
$64.02
FREE delivery Oct 3 - 9
Loading...
MBLABEL 350 Bags/Roll - 30x50cm(12x20in) Clear Plastic Bags for Groceries, Transparent Produce Bag for Fruits Vegetable Kitchen Food Storage, Small Reusable Poly Packing Bags

MBLABEL 350 Bags/Roll - 30x50cm(12x20in) Clear Plastic Bags for Groceries, Transparent Produce Bag for Fruits Vegetable Kitchen Food Storage, Small Reusable Poly Packing Bags

(127)
$49.98
PrimeFREE delivery Sat, Jun 14
Loading...
Sunrad Foil Art Kit for Kids Unicorns & Princesses Arts and Crafts, No Mess Art for Kids, Fun Craft Kits & Supplies, DIY Creative Activities, Travel Toys Gifts for Girls & Boys Ages 4 5 6 7 8 9+

Sunrad Foil Art Kit for Kids Unicorns & Princesses Arts and Crafts, No Mess Art for Kids, Fun Craft Kits & Supplies, DIY Creative Activities, Travel Toys Gifts for Girls & Boys Ages 4 5 6 7 8 9+

(162)
$23.99$19.72
FREE delivery Sat, Jun 14 on your first order
100+ bought in past month
Loading...
Sunrad Sewing Kit for Kids Beginner Arts and Crafts, Make 9 Easy DIY Projects, Unicorn & Animal Felt Craft Educational Toys Learn to Sew, Birthday Gifts for Girls Kids Age 6-8-10-12+

Sunrad Sewing Kit for Kids Beginner Arts and Crafts, Make 9 Easy DIY Projects, Unicorn & Animal Felt Craft Educational Toys Learn to Sew, Birthday Gifts for Girls Kids Age 6-8-10-12+

(170)
$19.99
FREE delivery Sat, Jun 14 on your first order
200+ bought in past month
Loading...
Liahelianx Mini Citrus Press - Handheld Lemon & Lime Juicer with Screw Top Lid, Compact Manual Juice Extractor for Cocktails, Drinks, Kitchen - Durable, Easy Clean, Portable Fruit Squeezer

Liahelianx Mini Citrus Press - Handheld Lemon & Lime Juicer with Screw Top Lid, Compact Manual Juice Extractor for Cocktails, Drinks, Kitchen - Durable, Easy Clean, Portable Fruit Squeezer

(0)
$7.69$6.45
FREE delivery Jun 18 - 20
Loading...
Peel Shot Glow Rice White Rice +Black Rice Soft Exfoliating Face And Body Scrub Dead Skin Cells Blackheads Remover For All Skin Types 100ml Scar Filler (Black+Yellow,100 g (Pack of 1))

Peel Shot Glow Rice White Rice +Black Rice Soft Exfoliating Face And Body Scrub Dead Skin Cells Blackheads Remover For All Skin Types 100ml Scar Filler (Black+Yellow,100 g (Pack of 1))

(4)
$15.99
$6.99 delivery Sep 12 - 19
900+ bought in past month
Loading...
Firefly Variety 8 Pack - Fire Starter Accessory for Swiss Army Victorinox Knives (Neon Green-Yellow Glow)

Firefly Variety 8 Pack - Fire Starter Accessory for Swiss Army Victorinox Knives (Neon Green-Yellow Glow)

(181)
$70.15$61.13
$5.05 delivery Thu, Jun 26Only 3 left in stock.