2
Your permission_based_hidding_of_sidebar
method looks like a view, not a context processor. A template context processor should return a dictionary, not an HTTP response from render()
It doesn’t make sense for it to use login_required
or csrf_exempt
decorators.
In your view, you do not need context_instance=RequestContext(request)
, the render
shortcut will automatically use a request to render the template.
Finally, you can fix the 1_8.W001
warning by updating your settings to use TEMPLATES
. You should then update the context_processors
in OPTIONS
, instead of setting TEMPLATE_CONTEXT_PROCESSORS
.
Source:stackexchange.com