django-slippers and DRY Django Templates

preview_player
Показать описание
This video will demonstrate the benefits of avoiding repeated code in your Django templates, by extracting common functionality to template fragments and passing contexts to the {% include %} template-tag.

We will also look at django-slippers - a UI component library for building repeatable components in your Django applications.

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

▶️ Full Playlist:

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

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

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

My wish is that Django team looks at htmx, hyperscript, alpine, tetra, slippers, and make a whole new templating language with these awesome features embedded

darkbluewalther
Автор

I love how simple and logical you make your videos!

martincronje
Автор

slippers! my new stack! I'd make sure to learn more on this and use it

dailypythontests
Автор

Great video, Lyle. I’m working on a big tailwindui based project. This will come in very handy. Thank you!

keyton_weissinger
Автор

Thanks for the great content u're always providing,
after seeing slippers in this video, I tried to use it to solve a problem I was facing which is calling a dynamic component by passing in a variable as the template name, (the caller determines which component to use to hold its content), I couldn't find this feature in slippers,
that's why I looked for similar packages, I found Django-component which offers the same functionality, and finally, we could add this feature after my pull request,

With this feature implemented, I can now move from extending templates to using reusable components.
Thanks for lighting the way.

manofhat
Автор

Great content again ! Always something to learn each time i see your notification.

seydinaoumarsamabaly
Автор

Thank you so much for this video! I really appreciate the valuable insights and tips you've provided. It's evident that you put a lot of effort into creating high-quality content that viewers like me can benefit from. I've learned so much from watching your videos and have implemented many of the best practices you've shared.

I encourage you to continue making more videos on best practices.

Vitalyayandex
Автор

I love VUE but want to go back to more traditional MPA feel. And looking to make the templating same experience. This could help with HTMX and now you also have the Tetra-framework in Django. I wonder if its not time to rethink the templating engine in Django?

onnot
Автор

Hello. This is a very useful feature. Thank you. This improved my code significantly

СергейГоцин
Автор

Great as always, I'm now very incentivized to use this. I know you its a little off topic but would really like a video or maybe link to an article on how I could use slippers with tailwind to create highly configurable responsive layouts (ex. if I pass something for a 2 column layout resembling "on medium or above screens, do 40% 60% split; on smaller than medium screens, stack on one column")

sudoscientist
Автор

Ey lad, love the scottish accent, real killer. Would be real nice if you could just display what you're trying to build and what you'll get out of the framework/tutorial. Thanks a lot.

Filipkasic
Автор

Great content, as always! Thanks a lot for all your great work :)

aleau
Автор

Thanks.
p.s. If you have some time could you please make a video about multiple steps forms ( may be a little bit outdated django formtools) or show some useful tools how to create and render a calendar in django app. Thank you in advance.

dodokwak
Автор

I knew about this package but never found any use for it, the video was still fun to watch. The example you gave could have been solved with a simple for loop (I mean slippers was not mandatory here to solve the DRY issue). Out of curiosity, have you ever used or do you know anyone who has used this in a real application?

tobidegnon
Автор

Why is there a "VISA" logo in the button? Did I missed something in the video or was it automatically added in by FlowBite?

FirdausAziz
Автор

Hope this library is safe from XSS, etc as it is passing around HTML.
And like always, Great Video !!

naumanarif
Автор

I tried Slippers based on this video, but unfortunately Pycharm, which I believe is an extremely popular IDE among Python developers, does not like special characters at the beginning of tag names and highlights it in red and it cannot be stopped. One may argue this is a Pycharm issue and not a Slippers issue, but given the size of Pycharm vs size of Slippers it is much easier to change Slippers. So the beginning and end string should be configurable in some way. Honestly this is such an easy change that I myself would probably be able to do it :-D And ought to.

SebastianDix-hkos