I get CSRF verification failed despite the fact that I am using {% csrf_token %}. Where is mistake?
<html>
<head>
<title>Name</title>
</head>
<body>
<h1>Tasks</h1>
<form action="" method="post">
{{ form.as_p }}
<input type="submit" name="add" value="add">
{% for a in comments %}
<h3>{{ a.body}}</h3>
<input type="submit" name="delete" value="delete" />
<input type="hidden" name="idcomment" id="{{a.id}}" value="{{a.id}}"/>
{% csrf_token %}
</form>
{% endfor %}
</body>
</html>
django.middleware.csrf.CsrfViewMiddleware
inMIDDLEWARE_CLASSES
? – alecxe Apr 3 '14 at 19:00render_to_response
orrender
– Sohan Jain Apr 3 '14 at 19:05