3 steps to upload files properly with Django and HTMX 📁

preview_player
Показать описание
Most Django tutorials give bad advice about how to upload files, emphasising server-side uploading

The Better way: We'll use Django and HTMX to upload files straight from the user's web browser (Client-side).

0:00 Intro and start
0:25 Section 1 - Setup S3 to upload our images
1:43 Section 2 - Create temporary upload url
2:45 Section 3 - Upload with HTMX to our temporary upload url
3:57 Show Run our server
4:09 Troubleshooting - Reminder to add your bucket name
4:28 Show Upload any file
5:00 Will other long-operations block the server?
Рекомендации по теме
Комментарии
Автор

Hey man! This tutorial is perfect RIGHT ON THE MONEY for this topic. THANK YOU very much for taking your PERSONAL TIME to make these videos!

PS! At this fucking JUICY and EPIC level that the actual content of your video is, things like mic-quality, audio compression, and (meh) maximizing UI-space for us poor short-sighted people are the only things I can think of making this a 9.8 / 10. Well played, sir!

All the best <3

forrestgump
Автор

This is the only tutorial I was able to find on this topic, really appreciate the effort.

hmaina
Автор

the best tutorials... i am getting better thanks to you

streamocu
Автор

Great tutorial Tom! This upload process bypasses Django file validation (file size, accepted file types) though right?

tugrulpinar
Автор

Any plans to do a video or an amendment to the article to discuss multipart uploads using a similar method? It seems no one else has done so thing similar online.

masonlyons
Автор

I really like how you use HTMX for this usecase, but aren't you uploading the file twice with this approach? Once when you select the file, that gets then send to the view, and a second time when the user actually uploads the file to S3 ? For large file uploads, that would be quite a problem for the user exp. Cheers!

michaeld
Автор

Which tool are you using for screen recording?

yanivtoledano