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!
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.
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)
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?
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" %}
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
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" %}
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
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.
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. ❤
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!
Haha wow, yea it’s been a while for sure! Happy new years to you too! 👊
Your videos talking about Django and HTMX are just amazing!! thanks dude!!
😊
This is such a nice addition to Django, especially when paired with HTMX. It really breathes new life into DTL. Thanks Dennis!
Iʼm a great fan of you from Uzbekistan 🇺🇿. Keep up!!
👊
Excellent video dude! - Happy New Year!
Happy new years to you too!!!
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.
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)
Wow great ! I'm a heavy user of django-render-block, but this partials package is awesome. I'll switch to it for sure
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
👊
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?
This looks awesome. If you can provide a complete tutorial for htmx + partials, it will be very useful for me.
Great works, Thanks! HTMX rocks! When I discovered htmx was like see the Matrix! 👽
Game changer for sure!
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" %}
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
🔥🔥
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" %}
I mean that is possible. I still see reason to separate into separate html files but this would work if done properly
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.
Does this mean we can now do partial server side rendering in django ?
That's the core of htmx, partial page rerenders.
Add a best django course video
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
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.
With that being said. Django is not the answer for everything. Some times a different tool makes sense
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?
@@AhmedZidan23-r9n Yes
Очень круто!
❤
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. ❤
we miss your tutorials man ,
pleas can you make video using Nextjs + django
I’m gonna be doing a lot of tutorials again, next js is in the mix ;)
nice.....
good