django-slippers and DRY Django Templates

แชร์
ฝัง
  • เผยแพร่เมื่อ 23 ม.ค. 2025

ความคิดเห็น • 49

  • @manofhat676
    @manofhat676 2 ปีที่แล้ว +2

    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.

  • @martincronje5242
    @martincronje5242 2 ปีที่แล้ว +2

    I love how simple and logical you make your videos!

  • @dailypythontests
    @dailypythontests 2 ปีที่แล้ว

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

  • @seydinaoumarsamabaly1806
    @seydinaoumarsamabaly1806 2 ปีที่แล้ว +1

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

  • @keyton_weissinger
    @keyton_weissinger ปีที่แล้ว +1

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

    • @bugbytes3923
      @bugbytes3923  ปีที่แล้ว

      Thank you, Keyton! Good luck with your project!

  • @darkbluewalther
    @darkbluewalther 2 ปีที่แล้ว +13

    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

    • @bugbytes3923
      @bugbytes3923  2 ปีที่แล้ว +3

      Yeah good shout. But I think the django team want to avoid enforcing a particular subset of technologies, so (for now) they keep the templates as generic as possible.

    • @martianmartian4037
      @martianmartian4037 2 ปีที่แล้ว +1

      Who is still using html rendering? Most modern days apps are single page application. In backend models serialised and returned. In frontend we use React, Angular or similar framework to render data.

    • @alexforget
      @alexforget 2 ปีที่แล้ว

      @@martianmartian4037 I really like Django, the admin, database management, but like you I feel that the rest of the world have moved on.
      Making small ajax updates and lot’s of tiny hooks is a lot of wasted dev time and is very error prone.

    • @djangoheroes7012
      @djangoheroes7012 2 ปีที่แล้ว +2

      @@alexforget don't let you fool into thinking, that SPA is so much better for ANY use case. It depends on the size and audience of the project in my opinion. there a still a lotta usecases, where the old approach is valid and better and faster. People try to forget this and feel a pressure to develop even little projects or microservices with SPA, because every COOL and MODERN Dev uses SPA. I am a django dev and django/python trainer and lot's of my customers (governments, companies) still use (with success) oldschool HTML-Rendinger.

  • @Vitalyayandex
    @Vitalyayandex ปีที่แล้ว

    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.

    • @bugbytes3923
      @bugbytes3923  ปีที่แล้ว

      Thanks very much for that comment, I'm glad the videos are helping you learn!
      I'll keep going for sure. If you have any requests, then feel free to share - thanks again.

  • @СергейГоцин
    @СергейГоцин ปีที่แล้ว

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

  • @onnot701
    @onnot701 2 ปีที่แล้ว +5

    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?

    • @bugbytes3923
      @bugbytes3923  2 ปีที่แล้ว +2

      Tetra framework looks interesting, I was not aware of it until now! Thanks!

  • @elyasnaimzada3919
    @elyasnaimzada3919 ปีที่แล้ว +1

    love all your videos keep up mate

    • @bugbytes3923
      @bugbytes3923  ปีที่แล้ว

      Thank you - will do. Thanks for watching!

  • @ale6au
    @ale6au 2 ปีที่แล้ว +1

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

    • @bugbytes3923
      @bugbytes3923  2 ปีที่แล้ว

      Thanks a lot for that comment!

  • @ahmedel-salamony4216
    @ahmedel-salamony4216 2 ปีที่แล้ว +1

    very useful
    big thanks, man

  • @sudoscientist255
    @sudoscientist255 ปีที่แล้ว

    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")

  • @repotranstech
    @repotranstech 2 ปีที่แล้ว +1

    Great content as always 👍.

  • @tomekklewicki9221
    @tomekklewicki9221 2 ปีที่แล้ว +1

    This is brilliant!

  • @zackmcnelly
    @zackmcnelly 2 ปีที่แล้ว +1

    Great Content Thanks!

  • @Filipkasic
    @Filipkasic 2 ปีที่แล้ว

    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.

  • @TheDRAGONFLITE
    @TheDRAGONFLITE 2 ปีที่แล้ว +1

    Cool video!

  • @MagnusAnand
    @MagnusAnand 11 หลายเดือนก่อน

    Nice video!!

    • @bugbytes3923
      @bugbytes3923  11 หลายเดือนก่อน

      Thanks - glad you liked it!

  • @FirdausAziz
    @FirdausAziz 2 ปีที่แล้ว

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

    • @bugbytes3923
      @bugbytes3923  2 ปีที่แล้ว

      Yeah, I just grabbed that button somewhat randomly from Flowbite.
      This is a basic demo so it doesn't really mean anything, but I guess it's cool to show that you can create these buttons easily with Tailwind.

  • @dodokwak
    @dodokwak 2 ปีที่แล้ว

    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.

  • @onnot701
    @onnot701 2 ปีที่แล้ว +1

    keep making these :)

  • @heltonteixeira9250
    @heltonteixeira9250 2 ปีที่แล้ว

    Awesome, tks for sharing :)

  • @tobidegnon4409
    @tobidegnon4409 2 ปีที่แล้ว

    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?

    • @bugbytes3923
      @bugbytes3923  2 ปีที่แล้ว +3

      Slippers provides a different approach - embedding the HTML within the declaration, and avoiding the verbose links to partial templates in {% include %} statements - you simply reference the component name.
      It can be a bit cleaner, but I agree it's a matter of preference. A lot of people do seem to like slippers (going from the django subreddit), but I can't say I've seen it much in the wild.

  • @naumanarif21
    @naumanarif21 2 ปีที่แล้ว

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

  • @SebastianDix-hk3os
    @SebastianDix-hk3os ปีที่แล้ว +1

    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.