Django & HTMX - Template Fragments with django-render-block

  Рет қаралды 7,528

BugBytes

BugBytes

Күн бұрын

Пікірлер: 45
@tobidegnon4409
@tobidegnon4409 2 жыл бұрын
I discovered this myself a few days ago reading htmx essay on template fragments, using it since and it really simplified my code, a great tool for any Django htmx dev
@bugbytes3923
@bugbytes3923 2 жыл бұрын
Agreed. I've been in a position in the past where the easiest thing to do was break small parts of code into their own files, and render these in HTMX responses. Not a disaster, but the templates quickly add up. Now, this tool will prevent having to do that - very useful for HTMX and in general!
@manofhat676
@manofhat676 2 жыл бұрын
You are always providing us with the best content, Thank you.
@bugbytes3923
@bugbytes3923 2 жыл бұрын
Thanks!
@GatewayITTutorials
@GatewayITTutorials 2 жыл бұрын
I've used a similar approach even before this article came out: 1) Create 1 html template file with all of the parts you need (for a specific page of course) 2) In the view check for HTMX header and a field name (or submit a custom header to check it in the backend) 3) Return a part of the template using the field name from the header (ie {% if header_value == "bla" %}Bla template{% endif %}) no third party extensions needed ;)
@bugbytes3923
@bugbytes3923 2 жыл бұрын
Interesting approach, sounds good!
@sebastianolivares2899
@sebastianolivares2899 Жыл бұрын
Hi, do you have a code example to guide us?
@GatewayITTutorials
@GatewayITTutorials Жыл бұрын
@@sebastianolivares2899 Post a question in my reddit forum, I'll try to put it together for you (look up the subreddit under one of my videos, I don't have it at hand, sorry)
@sebastianolivares2899
@sebastianolivares2899 Жыл бұрын
@@GatewayITTutorials I already did
@GatewayITTutorials
@GatewayITTutorials Жыл бұрын
@@sebastianolivares2899 thanks, I've seen the post. Will put something together today/tomorrow
@EazyTutor
@EazyTutor Жыл бұрын
Fantastic video and to the point. Well done @bugbytes.
@bugbytes3923
@bugbytes3923 Жыл бұрын
Thank you 🙏
@BenMcNelly
@BenMcNelly 2 жыл бұрын
This is very timely, thanks for the heads up and great video as always!
@bugbytes3923
@bugbytes3923 2 жыл бұрын
Thanks a lot!
@repotranstech
@repotranstech 2 жыл бұрын
Good work 👍, looking forward to more Htmx staff.
@bugbytes3923
@bugbytes3923 2 жыл бұрын
Thanks!
@michaelmabe4014
@michaelmabe4014 Жыл бұрын
Thanks for this video and the others that you have posted. I really like the way you step through whatever it is your trying to explain while keeping it at a quick pace . Worth the sub and like.
@bugbytes3923
@bugbytes3923 Жыл бұрын
Thanks a lot Michael - glad the videos have been helpful! And thanks for the sub!
@robhafemeister3100
@robhafemeister3100 2 жыл бұрын
Great video! Will definitely use with HTMX
@abrahamngetich1415
@abrahamngetich1415 2 жыл бұрын
Thanks you very much bro. Great insight on Django development. Learning HTMX with you has been
@bugbytes3923
@bugbytes3923 2 жыл бұрын
Thanks bro.
@sidds09
@sidds09 2 жыл бұрын
pls do a complete django project with alpinejs and HTMX.. it still needs to be seen if these could be used to build something big and scalable. using these in fragments is easier, but actual purpose can only be seen with some heavy work. it would be great to have something that saves us from going to react/vue, every time we build something for market.
@Herdogan80
@Herdogan80 2 жыл бұрын
Another great content. Thanks for sharing it. 💯
@bugbytes3923
@bugbytes3923 2 жыл бұрын
Thanks, glad you liked it!
@aerotow
@aerotow 11 күн бұрын
Thanks! Wouldn't it make sense to use the booklist view also on first load instead of passing from the main view? Feels a bit unintuitive to have to maintain it at two places and keep it consistent.
@MagnusAnand
@MagnusAnand 2 жыл бұрын
Great video. I have a suggestion for a different topic that will help with Django topics in general: deployment 😉
@bugbytes3923
@bugbytes3923 2 жыл бұрын
Thanks! And yeah, I'm going to be bringing some deployment stuff onto the channel soon. I've prepared content for deploying Django apps to AWS ElasticBeanstalk - I'll be recording that one soon. Any other platforms you'd be interested in seeing videos for?
@oscardonas4305
@oscardonas4305 10 ай бұрын
Thanks for the great explanation. What if I want the last book name to be visible in the input form? I mean, I would like to see the book name added in the panel below and the name also shown in the the form, just to compare that the added record is just what I typed before. Hope you can answer my question
@paoloromolini
@paoloromolini 2 жыл бұрын
Really helpful, thanks a lot!
@bugbytes3923
@bugbytes3923 2 жыл бұрын
Thank you!
@robertowork7311
@robertowork7311 2 жыл бұрын
Hello friend, I wanted to thank you for the excellent videos about django and htmx. And also ask yourself, do you plan to make a video on how to integrate vite to django?
@dodokwak
@dodokwak 2 жыл бұрын
Thx. Do you think this approach will be suitable for an appointment application? Still hesitate.
@fcutmovieproductions
@fcutmovieproductions 2 жыл бұрын
anyone. I appreciate it!!
@surendrasrikakolapu7972
@surendrasrikakolapu7972 2 жыл бұрын
Is it possible for authentication (login, register) too? means template fragments...... Anyway great work !
@bugbytes3923
@bugbytes3923 2 жыл бұрын
Yes, it would definitely be possible for login and registration forms to create these fragments/blocks.
@elpalochebas9416
@elpalochebas9416 Жыл бұрын
Hi, do you recommend for medium or Big proyects?
@cjensen2k
@cjensen2k Жыл бұрын
Do you have a repository with the completed code using the `django-render-block` package?
@Septumsempra8818
@Septumsempra8818 Жыл бұрын
I'm struggling with this. I was getting a lot of recursion errors and too little help. Imma try this out, I hope it works. s/o from South Africa
@ChaminduWeerasinghe
@ChaminduWeerasinghe 2 жыл бұрын
Thanks for tNice tutorials content. It was the first soft soft video I've seen that didn't assu I knew my way around all of the functions.
@RellonLawrence
@RellonLawrence 2 жыл бұрын
How would you do it with CBV?
@tungtung7504
@tungtung7504 2 жыл бұрын
Hopy admin build multi form post one templates…. Thanks
@slavishka7576
@slavishka7576 2 жыл бұрын
*video continues* "........you can change the tempo by clicking and DRAGGING"
@nurisafif9932
@nurisafif9932 2 жыл бұрын
I swearr
@wajahatalibasharat6923
@wajahatalibasharat6923 2 жыл бұрын
LOL
Django and HTMX #20 - 3-Level Chained Dropdowns
15:43
BugBytes
Рет қаралды 6 М.
The IMPOSSIBLE Puzzle..
00:55
Stokes Twins
Рет қаралды 68 МЛН
小路飞还不知道他把路飞给擦没有了 #路飞#海贼王
00:32
路飞与唐舞桐
Рет қаралды 74 МЛН
Who's spending her birthday with Harley Quinn on halloween?#Harley Quinn #joker
01:00
Harley Quinn with the Joker
Рет қаралды 20 МЛН
1, 2, 3, 4, 5, 6, 7, 8, 9 🙈⚽️
00:46
Celine Dept
Рет қаралды 78 МЛН
JWT авторизация. Основы JWT - механизма.
6:45
Хочу вАйти
Рет қаралды 15 М.
HTMX for Impatient Devs
8:33
Isaac Harris-Holt
Рет қаралды 59 М.
UV - A modern python project and dependency manager
6:19
Timnology
Рет қаралды 6 М.
HTMX заменит Frontend?! WTF?
12:12
Как пройти в IT?
Рет қаралды 113 М.
Dynamic list views with Django and htmx
34:09
Matt Segal
Рет қаралды 14 М.
The IMPOSSIBLE Puzzle..
00:55
Stokes Twins
Рет қаралды 68 МЛН