i have template base.html and some children templates. I don't know how to set variables for base.html
for example if i have {% for u in users %}{% endfor %}
where do I assign it to users? is there some parent view for all views?
i have template base.html and some children templates. I don't know how to set variables for base.html
for example if i have {% for u in users %}{% endfor %}
where do I assign it to users? is there some parent view for all views?
You don't assign variables separately to parent templates. A template extends a parent template, and the whole thing just has one context for variables.
I suggest you reread the Django documentation on templates and inheritance.
If you want certain variables to be available in all templates, you could write a template context processor (docs) and make sure you always use RequestContext
when rendering templates.