On Tue, Sep 23, 2008 at 8:43 PM, Brian Beck <[EMAIL PROTECTED]> wrote: > The problem is that any token, no matter where we generate it, isn't > going to be submitted back with the POST request unless it's a field > in the form that was submitted. So the only options I see are > mangling the HTML to add these fields (CsrfMiddleware), or add them to > the form objects (SafeForm).
There is another option, a template tag. I would implement it as a middleware and a template tag. Template tag csrf_protect, will require CSRFMiddleware and django.core.context_processors.request, will add a input file containing something derived from {{ request }} and middleware will check and raise HttpForbidden. Its so ugly that it does not deserve a form validation error in my opinion. This will require least amount of changes in existing sites. -- Amit Upadhyay Vakow! www.vakow.com +91-9820-295-512 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-developers?hl=en -~----------~----~----~----~------~----~------~--~---