First impressions - Django template partials

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

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

  • @ArtificialDumbnes
    @ArtificialDumbnes 7 วันที่ผ่านมา +3

    bro I used to watch your django videos in 2020 and learnt so much from you as a beginner developer even built my website and hosted it on heroku(those free days of heroku)!!!! I still remember most of the fundamentals you thought. seeing you after so long make soo happyyy and i am quite impressed you are still doing django lol. A very Heartfelt Thankss to you!!!! Happy New Yearrr!

    • @DennisIvy
      @DennisIvy  6 วันที่ผ่านมา

      Haha wow, yea it’s been a while for sure! Happy new years to you too! 👊

  • @MarceloAgostonSchrotlin
    @MarceloAgostonSchrotlin 11 วันที่ผ่านมา +3

    Your videos talking about Django and HTMX are just amazing!! thanks dude!!

    • @DennisIvy
      @DennisIvy  10 วันที่ผ่านมา +1

      😊

  • @KGIV
    @KGIV 11 วันที่ผ่านมา

    This is such a nice addition to Django, especially when paired with HTMX. It really breathes new life into DTL. Thanks Dennis!

  • @AlDasturchi
    @AlDasturchi 11 วันที่ผ่านมา +1

    Iʼm a great fan of you from Uzbekistan 🇺🇿. Keep up!!

    • @DennisIvy
      @DennisIvy  10 วันที่ผ่านมา

      👊

  • @themarksmith
    @themarksmith 11 วันที่ผ่านมา

    Excellent video dude! - Happy New Year!

    • @DennisIvy
      @DennisIvy  10 วันที่ผ่านมา

      Happy new years to you too!!!

  • @Nicfallenangel
    @Nicfallenangel 9 วันที่ผ่านมา

    Partials were a life changer for me. They made it so easy to pull in pages and content quickly. If you are a fan of hx-push-url, they even make back button and refresh integration better creating a DRF style setup. I write one template for each page, but then any htmx request to that template just pulls the partial I need. For example, you keep the header and nav the same on each page between say profiles and blog posts, both of those pages extend the base html with your header/nav, then the htmx request only renders in the partial, and updates the url. Now if someone clicks back or refreshes the page, the browser asks for the same url without htmx, and django will return the complete page back and not just the partial. If you are a fan of traditional components, I also recommend checking out django-cotton. You create component templates in django's template framework, and then can pass the context variables to them via html attributes. They have a traditional catch-all that will render everything inside your tags out to the body of the component. I've mixed cotton in to handle Tailwind CSS classes more seamlessly for me, and then partials to handle the more complex component/section generation.

    • @Nicfallenangel
      @Nicfallenangel 9 วันที่ผ่านมา

      Anyone interested in cotton can find the project at django-cotton.com (and no, I'm not involved in the project, just a fan of how easy it makes things for me)

  • @MayasMess
    @MayasMess 10 วันที่ผ่านมา

    Wow great ! I'm a heavy user of django-render-block, but this partials package is awesome. I'll switch to it for sure

  • @theanonymous92
    @theanonymous92 10 วันที่ผ่านมา

    thank you so much for this
    I used to think that there has to be a way to get around this partials dir where I keep my partials
    thank you so much again

    • @DennisIvy
      @DennisIvy  10 วันที่ผ่านมา +1

      👊

  • @RickyBobby-g8n
    @RickyBobby-g8n 3 วันที่ผ่านมา

    Cool stuff, looks like it fits real nice with htmx. Btw when using htmx couldn't you get something similar by using hx-select on the target partial from the response template?

  • @anishpillai
    @anishpillai 10 วันที่ผ่านมา

    This looks awesome. If you can provide a complete tutorial for htmx + partials, it will be very useful for me.

  • @gregoriopazh.4840
    @gregoriopazh.4840 11 วันที่ผ่านมา

    Great works, Thanks! HTMX rocks! When I discovered htmx was like see the Matrix! 👽

    • @DennisIvy
      @DennisIvy  10 วันที่ผ่านมา +1

      Game changer for sure!

  • @krzysiekkrzysiek9059
    @krzysiekkrzysiek9059 11 วันที่ผ่านมา

    4:52 I don't get it why use `partial`. You made the `right_side.html` template for including it in another specified template (index.html). So include it directly to `about.html` like previously with {% include "right_side.html" %}

    • @theanonymous92
      @theanonymous92 10 วันที่ผ่านมา +1

      well, it kind of tries to achieve the clean and minimal approach
      if you r using include that means you are definitely going to have a template in your templates folder
      which eventually means an extra file...Now that's okay, because it already is a lot cleaner
      but if say you r using htmx and now you want to be able to change click button with clicked button , or success with failed or minimal things like these
      you probably will be maintaining a subfolder 'partials' in templates folders that will be containing a file for each of these few lines of html which I think you'd agree that they don't need to have a complete file for this ...
      and this kind of solves that

  • @hosseinfirouzgan
    @hosseinfirouzgan 11 วันที่ผ่านมา +1

    🔥🔥

  • @diegomiguel929
    @diegomiguel929 10 วันที่ผ่านมา

    So, what if we save all the components in an HTML file and use that HTML file to showcase the components, similar to Figma? I think it would be a great way to keep the code structure organized. We could simply import the components like {% include "buttons.html#greenbtn" %}

    • @DennisIvy
      @DennisIvy  10 วันที่ผ่านมา

      I mean that is possible. I still see reason to separate into separate html files but this would work if done properly

  • @zsmain
    @zsmain 11 วันที่ผ่านมา

    Yes, it looks very useful with HTMX, I would still use include on a separate template (If I am not not using HTMX) to make things clean.

  • @aliasgar.burhani1099
    @aliasgar.burhani1099 11 วันที่ผ่านมา

    Does this mean we can now do partial server side rendering in django ?

    • @repotranstech
      @repotranstech 8 วันที่ผ่านมา

      That's the core of htmx, partial page rerenders.

  • @sheakinm456
    @sheakinm456 วันที่ผ่านมา

    Add a best django course video

  • @tomthink2
    @tomthink2 11 วันที่ผ่านมา

  • @AhmedZidan23-r9n
    @AhmedZidan23-r9n 6 วันที่ผ่านมา

    Hello dennis, could you please tell me if I can find freelancing job opportunities with django? I just started learning it and I thought you would know too much about that, thank you

    • @DennisIvy
      @DennisIvy  6 วันที่ผ่านมา

      When freelancing the tech stack is up to you in many cases. Most clients from my expirence just want the job done. So if Django makes sense for a particular project, why not.

    • @DennisIvy
      @DennisIvy  6 วันที่ผ่านมา

      With that being said. Django is not the answer for everything. Some times a different tool makes sense

    • @AhmedZidan23-r9n
      @AhmedZidan23-r9n 5 วันที่ผ่านมา

      Do you mean that it does matter which tool you use, the most important thing is to achieve the goal like developing a web app?

    • @DennisIvy
      @DennisIvy  5 วันที่ผ่านมา +1

      @@AhmedZidan23-r9n Yes

  • @volzhanka2498
    @volzhanka2498 10 วันที่ผ่านมา

    Очень круто!

    • @DennisIvy
      @DennisIvy  10 วันที่ผ่านมา

  • @dj_sai_1679
    @dj_sai_1679 9 วันที่ผ่านมา

    Hii, Dennis, I Love your content on Django, Could You Suggest some real life project that I can make a website or something on it, for my last year project, Thanks. ❤

  • @alexdin1565
    @alexdin1565 11 วันที่ผ่านมา

    we miss your tutorials man ,
    pleas can you make video using Nextjs + django

    • @DennisIvy
      @DennisIvy  10 วันที่ผ่านมา +1

      I’m gonna be doing a lot of tutorials again, next js is in the mix ;)

  • @michmax7164
    @michmax7164 11 วันที่ผ่านมา

    nice.....

  • @frameff9073
    @frameff9073 11 วันที่ผ่านมา

    good