[Answer]-Django – A Variable to Check in Base Template That Is Modified By View Functions

1👍

When you return base.html to be rendered, add from django.shortcuts import render_to_response to the top of your views.py and put the following in both my_funcs:

return render_to_response('base.html', {'has_sidebar': has_sidebar})

Leave a comment