.Imagine that you have a fixed 30-year interest rate for your mortgage, and the economy has experienced unanticipated inflation. Examine who the winner and loser would be. Is it the borrower or the…
Django has this amazing feature of templating static HTML files to serve them as dynamic pages. If I want to add a title to my web page.
But what if I want to add different titles for different pages? Like Home for home page and cart page as Cart.
So for this we use template tags already defined in Django. I use
for replacing title blocks in each page extended from a base template with a blank title block like this
using another pre-defined template tag. Here {% %} is a template tag that is being used for adding data to static html pages by Django
These are the few steps you must follow:-
Here we are registering a custom tag with name remainder which takes value and arg from template like this
and returns the remainder.
First, we have to load the custom tag. And then we can use them as we want. I am checking the number of coins is even or not.
As I am writing this, I am joined by Gizmo, my cat, who, after walking around me in circles for five minutes and rubbing his head against my laptop twenty times, has finally decided to curl up in my…
Our design ambassador, Jane Carolan from Venia Design, shares spring design trends for flooring. Find out more here.. “Radiant Earth” is published by Liza Lee.
Apache Kafka is a distributed, horizontally scalable, fault-tolerant streaming platform that has the capability to publish, subscribe, process, and store streams of records. Kafka is a distributed…