[Django]-Request is missing from context

3👍

The problem was not related to localeurl, with the following view works:

return render_to_response( 'base.html', {}, context_instance = RequestContext(request))

I thought putting django.core.context_processors.request into TEMPLATE_CONTEXT_PROCESSORS do the job, but not.

👤balazs

0👍

Locale URL middleware hacks request.path I think what you’re looking for is request.path_info

0👍

In your view, when returning a response, specify the context_instance like this:

from django.shortcuts import render_to_response
from django.template.context import RequestContext

return render_to_response('base.html',{'object':object},context_instance=RequestContext(request))

Leave a comment