I have a base template file (base.html) and every other template extends to it and generates content using its blocks. Certain variables, such as nav_obj, are used in the base template file.
View:
nav_obj = NavigationObject.objects.all()
Base template:
{% for object in nav_obj %}
<a href="{{ object.link }}">{{ object.title }}</a>
{% endfor %}
At the moment, I need to pass nav_obj in every view. Is there any way to have this sent automatically?
Write your own context processor.