The rendered template contains the following:
invalid context variable: 'request.META.REQUEST_METHOD'
I printed our locals() inside the view and I can clearly see
META:{
'REQUEST_METHOD': 'GET',
...
}
Any ideas on what could cause this ?
For your template to receive the
requestobject, you will need to render the template with aRequestContext.If you are using
django.shortcuts.render_to_responsesomething like the below:then you should note that, from the linked docs:
and you will want to instead use the following construct:
However, better still would be to use
django.shortcuts.render(introduced in Django 1.3) which uses aRequestContextby default, so you can just: