On 08/06/2010 01:15 AM, ignacio.arriaga wrote:

Hello,

I have a problem with django.contrib comments application. I have
installed the applicacion and made the synchronization with the
database. I create a comment form in this way:

{% render_comment_form for project %}

When I push either preview or submit I get a 403 error related with
csrf protection. I have the Csrf middleware activated.

I am using django 1.2 with python 2.6.

You're probably missing the csrf_token tag in your form.

From http://docs.djangoproject.com/en/dev/ref/contrib/csrf/ :

  In any template that uses a POST form, use the csrf_token tag
  inside the <form> element if the form is for an internal URL, e.g.:

  <form action="" method="post">{% csrf_token %}


So just add that csrf_token tag and you're probably done.


Reinout

--
Reinout van Rees - rein...@vanrees.org - http://reinout.vanrees.org
Programmer at http://www.nelen-schuurmans.nl
"Military engineers build missiles. Civil engineers build targets"

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to