Django & HTMX - django-template-partials for Template Partial Responses

preview_player
Показать описание

In this video, we look at the new django-template-partials library, developed by Carlton Gibson. This library gives us an easy way to define and reference partial templates (template fragments) in our Django template code, and then return these partials as a response to an HTMX (or other) request.

📌 𝗖𝗵𝗮𝗽𝘁𝗲𝗿𝘀:
00:00 Intro
03:13 Creating the Django template
05:39 Submitting form with HTMX
10:31 Returning template fragment with django-template-partials

☕️ 𝗕𝘂𝘆 𝗺𝗲 𝗮 𝗰𝗼𝗳𝗳𝗲𝗲:
To support the channel and encourage new videos, please consider buying me a coffee here:

▶️ Full Playlist:

𝗦𝗼𝗰𝗶𝗮𝗹 𝗠𝗲𝗱𝗶𝗮:

📚 𝗙𝘂𝗿𝘁𝗵𝗲𝗿 𝗿𝗲𝗮𝗱𝗶𝗻𝗴 𝗮𝗻𝗱 𝗶𝗻𝗳𝗼𝗿𝗺𝗮𝘁𝗶𝗼𝗻:

#python #django #webdevelopment #htmx
Рекомендации по теме
Комментарии
Автор

I can't express enough how simple it is to integrate with existing projects. Other alternatives in comparison just makes me cry.

proofit
Автор

I think this is really the best way to render partials with django-htmx. Thank you so much for all the videos you make, your tutorials make me a much more skillful developer!

ИгорьВоевода-ът
Автор

Amazing tutorial, very easy to follow and understand how all the pieces come together. Would love to see a tutorial on setting up Django with SvelteKit and using them together.

Keep up the amazing work!

james_anderson
Автор

great video's as always. If I may give one suggestion. When working with forms + htmx + swapping it would always be nice to show how to give back a form for validation on errors, how to swap ooob and how to manage all those nity little triggers for behavior

onnot
Автор

This makes htmx easier with django, mostly when rendering ! Thank you mate !

seydinaoumarsamabaly
Автор

More beautiful tutorials. I've not used this or the other block/partial packages so this was new for me. Could you not have used the have been a faster way to clear the form?

khunjohn
Автор

Django+htmx is cool! Thanks for the great video!

МаксимБалашов-мг
Автор

Awesome stuff and perfect timing once again. Much cleaner than render-block.

robhafemeister
Автор

I learn a lot about htmx thanks to you. 👍

allieuslee-yqmz
Автор

Amazing. You always make video that i'm looking for.

krystian-magdziarz
Автор

Very interesting approach to exchange - well - partials of a page! Well presented, thanks for this! Nice

kai.diefenbach
Автор

Thanks for the tutorial, very informative. One small thing though; the blog post is still using the afterSwap event in the script that is used to clear the form.

Panzerboy
Автор

Very handy, thanks for the clear video once again

thomasdb
Автор

Cool video as always, thanks, you taught me all I know about htmx.

repotranstech
Автор

Thanks one more time for the great tutorial!

aleau
Автор

Out of curiosity - how does this work if there are errors in the form? Does the `.reset()` method clear out what the user has entered even if there are errors?

hanny
Автор

Thank you so much for this video, you always have the best content, one question, for some reason i cant clear a Summernote form after positing, i tried a lot of method including the htmx one but nothing is working, any help would be appreciated

CodeForChange
Автор

Hello, I have a question please, can we return more than one partial using the render function ?

amine
Автор

The button :active state stays in the same state after form.reset()… How would it look like (with AlpineJS) the form reset and the buttton normal state when form submitted?

mrfran
Автор

can you make a full tutorial on django channels and htmx?

rampageshary