I\'m getting many failures from the CSRF Django middleware on my site (the version from SVN trunk.) The only errors I get are: CSRF failure: reason=CSRF token missing or incorr
Make sure your view function for GET Request looks like this:
def login_view():
c = {}
c.update(csrf(request))
request.session.set_expiry(0)
if request.method == 'GET':
return render_to_response('newform.html',c)
Then check the view source for your newform.html, it must have Hidden field.
<`form action="" method="post" name="loginform"> <`div style='display:none'`><`input type='hidden' name='csrfmiddlewaretoken' value='6f4dee99ab2f5e7201e057cb63' />
Here, action can refer the same page, action=""
.