I’ve a little problem with adding a csrf_token on my form in Django (1.2.5), though I’ve added all the necessary middleware classes
{% csrf_token %}
gives the ...name 'csrf_token' is not defined error.
What is the problem?
Sultan
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You need to check out your
MIDDLEWARE_CLASSESand ensure that the CSRF middleware is in there. As of Django 1.2, this wasdjango.middleware.csrf.CsrfViewMiddleware— ensure that you’re using the right class by reading the Django documentation on middleware.