Let's say I have a base template with a header in it, and the content of that header needs to be passed into the template.
<header>
You are logged in as {{ name }}
</header>
This base template gets extended by many pages. How can I pass in that variable without passing it to each individual child? For example, I don't want to have to do this:
render_template("child1.html", name=user.name)
render_template("child2.html", name=user.name)
render_template("child3.html", name=user.name)
etc...
because who knows how many child pages I might have. It doesn't feel DRY enough.
I never actually render the base template, only its children, but I don't know how else to pass in data.
Is there a way to do this? Should I not be using inheritance?