I need the request object in all admin templates. In frontend templates, I can achieve this by rendering the template with RequestContext
:
return render_to_response('my_template.html',
my_data_dictionary,
context_instance=RequestContext(request)
)
With that, I can access the request object in frontend:
{{ request.path }}
How can I do this for all admin views in Django 1.2?
The request should be available in the admin templates if you have 'django.core.context_processors.request'
added to your TEMPLATE_CONTEXT_PROCESSORS
in your settings.py
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With