How to get at request in a template

I needed to get at the request in a template which had been called ‘direct_to_template’. To make the request available, you need to modify the TEMPLATE_CONTEXT_PROCESSORS variable.

Add this to your settings file

<code>
TEMPLATE_CONTEXT_PROCESSORS = (
    'django.core.context_processors.request',
)
</code>

Then you can use {{ request }}