Django 1.2 and Cross Site Request Forgery

22 views
Skip to first unread message

Steve Bywater

unread,
Jul 14, 2010, 5:13:15 PM7/14/10
to Python Security
One of the things that attracted me to django was it's built-in
support for many things like CSRF protection. I've been working under
the assumption that my production code is safe in that regard, site
wide.

If you have the same assumption, check out http://djangoadvent.com/1.2/django-12-and-csrf/,
which offers a good background in CSRF protection in django, why it
wasn't up to snuff, and how it is now better. But more importantly, it
wasn't until reading it that I discovered I now have to add {%
csrf_token %} to any form on which you want to have CSRF protection.

mdipierro

unread,
Jul 22, 2010, 12:04:58 PM7/22/10
to Python Security
web2py does this since 2008 and all forms generated by web2py (FORM,
SQLFORM, crud.*) do this by default without you having to insert any
token.

Massimo

On Jul 14, 4:13 pm, Steve Bywater <stephen.bywa...@gmail.com> wrote:
> One of the things that attracted me to django was it's built-in
> support for many things like CSRF protection. I've been working under
> the assumption that my production code is safe in that regard, site
> wide.
>
> If you have the same assumption, check outhttp://djangoadvent.com/1.2/django-12-and-csrf/,
Reply all
Reply to author
Forward
0 new messages