I'm trying to use Django-registration, but I'm getting this error for login:
Forbidden (403)
CSRF verification failed. Request aborted.
This is my form:
<form action="." method="post" class="login_form">{% csrf_token %}
{{ form.as_p }}
<p class="submit"><button class="btn btn-lg btn-primary btn-block" type="submit" name="submit" value="Login">Log in</button></p>
{% if next %}<input type="hidden" name="next" value="{{ next }}">
{% else %}<input type="hidden" name="next" value="/">
{% endif %}
</form>
My settings:
MIDDLEWARE_CLASSES = (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
)
Make sure that you are passing back the context from your view
return render_to_response('contact.html', {'form': form},context_instance=RequestContext(request))