I\'m doing wiki in django tutorial and in tutorial earlier version of django is used where csrf token is not compulsory. I\'ve added {% csrf_token %} to the form, however I\'m n
You don't need to do anything more.
Just place {% csrf_token %}
into your form and send it via POST.
All other stuff will be done inside django.middleware.csrf.CsrfViewMiddleware
.
You should enable it in your settings.py
(if you haven't done this):
MIDDLEWARE_CLASSES += (`django.middleware.csrf.CsrfViewMiddleware`,)
TEMPLATE_CONTEXT_PROCESSORS += (`django.core.context_processors.csrf`,)
Last line is not required if you use RequestContext
(not a simple Context
) in your templates (Note: render_to_response()
uses Context
when direct_to_template()
uses RequestContext
)