filmov
tv
Template Inheritance In Django - Part8 - Django Tutorials

Показать описание
Hi Awesome Learners! welcome. In this part, we are going to explore the concept of template inheritance of Django.
Join :
Think of a case from our page the navbar will be the same for all our pages. It's not good if we will write the same code again and again, are you thinking that we will take all the common codes to one HTML file and import them in others in this way we have to do less effort, Yes you are correct this is template inheriting and flask use jinja to perform this job.
Now compare both the file you will get what block content is doing it is adding the file to the parent file.
Now save all and restart you will see your index page.
As always save all, restart the server and open the link you will see something awesome :)
Complete Playlist:
Thank You
Keep Learning & Keep Growing
#TWP #DjangoTutorials #LearnOnLockdown
Join :
Think of a case from our page the navbar will be the same for all our pages. It's not good if we will write the same code again and again, are you thinking that we will take all the common codes to one HTML file and import them in others in this way we have to do less effort, Yes you are correct this is template inheriting and flask use jinja to perform this job.
Now compare both the file you will get what block content is doing it is adding the file to the parent file.
Now save all and restart you will see your index page.
As always save all, restart the server and open the link you will see something awesome :)
Complete Playlist:
Thank You
Keep Learning & Keep Growing
#TWP #DjangoTutorials #LearnOnLockdown