Django & HTMX - django-template-partials for Template Partial Responses
Blog Post: https://bugbytes.io/posts/rendering-template-fragments-with-django-template-partials/ Starter Code: https://github.com/bugbytes-io/template-partials-demo 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 17:00 Clearing form fields after HTMX request with form.reset() function โ๏ธ ๐๐๐ ๐บ๐ฒ ๐ฎ ๐ฐ๐ผ๐ณ๐ณ๐ฒ๐ฒ: To support the channel and encourage new videos, please consider buying me a coffee here: https://ko-fi.com/bugbytes โถ๏ธ Full Playlist: https://www.youtube.com/playlist?list=PL-2EBeDYMIbRByZ8GXhcnQSuv2dog4JxY ๐ฆ๐ผ๐ฐ๐ถ๐ฎ๐น ๐ ๐ฒ๐ฑ๐ถ๐ฎ: ๐ Blog: https://bugbytes.io/posts/rendering-template-fragments-with-django-template-partials/ ๐พ Github: https://github.com/bugbytes-io/template-partials-demo ๐ฆ Twitter: https://twitter.com/bugbytesio ๐ ๐๐๐ฟ๐๐ต๐ฒ๐ฟ ๐ฟ๐ฒ๐ฎ๐ฑ๐ถ๐ป๐ด ๐ฎ๐ป๐ฑ ๐ถ๐ป๐ณ๐ผ๐ฟ๐บ๐ฎ๐๐ถ๐ผ๐ป: Starter Code: https://github.com/bugbytes-io/template-partials-demo django-template-partials: https://github.com/carltongibson/django-template-partials Carlton Gibson DjangoCon talk: https://www.youtube.com/watch?v=_3oGI4RC52s Adding CSRF Token to POST request: https://django-htmx.readthedocs.io/en/latest/tips.html#make-htmx-pass-the-csrf-token #python #django #webdevelopment #htmx
Download
1 formatsVideo Formats
Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.