I would like to know how to pass a variable to all my templates, without repeating the same code on every method in my views.py file?
In the example below I would l
As seen in this example, post Django 1.3 you can simply use render instead of render_to_response
which doesn't require you to explicitly pass the context processor.
def another_view_method(request):
categories = Category.objects.all()
return render(
'eg/front_page.html',
{'is_logged_in': is_logged_in(request), 'categories':categories}
)