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
@bugbytes39232 жыл бұрын
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!
@GatewayITTutorials2 жыл бұрын
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 ;)
@bugbytes39232 жыл бұрын
Interesting approach, sounds good!
@sebastianolivares28992 жыл бұрын
Hi, do you have a code example to guide us?
@GatewayITTutorials2 жыл бұрын
@@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)
@sebastianolivares28992 жыл бұрын
@@GatewayITTutorials I already did
@GatewayITTutorials2 жыл бұрын
@@sebastianolivares2899 thanks, I've seen the post. Will put something together today/tomorrow
@manofhat6762 жыл бұрын
You are always providing us with the best content, Thank you.
@bugbytes39232 жыл бұрын
Thanks!
@BenMcNelly2 жыл бұрын
This is very timely, thanks for the heads up and great video as always!
@bugbytes39232 жыл бұрын
Thanks a lot!
@EazyTutor Жыл бұрын
Fantastic video and to the point. Well done @bugbytes.
@bugbytes3923 Жыл бұрын
Thank you 🙏
@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 Жыл бұрын
Thanks a lot Michael - glad the videos have been helpful! And thanks for the sub!
@repotranstech2 жыл бұрын
Good work 👍, looking forward to more Htmx staff.
@bugbytes39232 жыл бұрын
Thanks!
@Herdogan802 жыл бұрын
Another great content. Thanks for sharing it. 💯
@bugbytes39232 жыл бұрын
Thanks, glad you liked it!
@robhafemeister31002 жыл бұрын
Great video! Will definitely use with HTMX
@abrahamngetich14152 жыл бұрын
Thanks you very much bro. Great insight on Django development. Learning HTMX with you has been
@bugbytes39232 жыл бұрын
Thanks bro.
@paoloromolini2 жыл бұрын
Really helpful, thanks a lot!
@bugbytes39232 жыл бұрын
Thank you!
@sidds092 жыл бұрын
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.
@MagnusAnand2 жыл бұрын
Great video. I have a suggestion for a different topic that will help with Django topics in general: deployment 😉
@bugbytes39232 жыл бұрын
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?
@aerotowАй бұрын
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.
@dodokwak2 жыл бұрын
Thx. Do you think this approach will be suitable for an appointment application? Still hesitate.
@oscardonas4305 Жыл бұрын
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
@elpalochebas9416 Жыл бұрын
Hi, do you recommend for medium or Big proyects?
@cjensen2k Жыл бұрын
Do you have a repository with the completed code using the `django-render-block` package?
@robertowork73112 жыл бұрын
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?
@surendrasrikakolapu79722 жыл бұрын
Is it possible for authentication (login, register) too? means template fragments...... Anyway great work !
@bugbytes39232 жыл бұрын
Yes, it would definitely be possible for login and registration forms to create these fragments/blocks.
@fcutmovieproductions2 жыл бұрын
anyone. I appreciate it!!
@RellonLawrence2 жыл бұрын
How would you do it with CBV?
@Septumsempra88182 жыл бұрын
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
@tungtung75042 жыл бұрын
Hopy admin build multi form post one templates…. Thanks
@ChaminduWeerasinghe2 жыл бұрын
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.
@slavishka75762 жыл бұрын
*video continues* "........you can change the tempo by clicking and DRAGGING"