CSRF verification failed. Request aborted.
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/2b21261b-c48f-43d2-8db0-810b0c7a9c02%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Why are you adding a csrf token in your context?
____________________________________________________________________
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/ed8d597a-5897-4be2-9402-f77d464700ff%40googlegroups.com.
On 30 Aug 2014 07:15, "James Schneider" <jrschn...@gmail.com> wrote:
>
> I reread the OP, and it sounds like he is using a static HTML page served elsewhere and POSTing directly to the Django app. If you disable CSRF validation on the form view in Django, it should work. However, I would recommend against it.
>
> Unless you have a specific reason, why not just write up a quick TemplateView (with CSRF disabled on the FormView) or better yet a straight FormView class and just render the exact HTML you posted with the CSRF tag, taking advantage of the benefits that the Django framework offers?
>
> -James
>
This is exactly where i was going.
Did you actually try it?
>> Is any other alternative ways to do this task.
>> Thanks :)
>>
>>
>>
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google Groups "Django users" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
>>>> To post to this group, send email to django...@googlegroups.com.
>>>> Visit this group at http://groups.google.com/group/django-users.
>>>> To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/2b21261b-c48f-43d2-8db0-810b0c7a9c02%40googlegroups.com.
>>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>>
>> --
>> You received this message because you are subscribed to the Google Groups "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
>> To post to this group, send email to django...@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/ed8d597a-5897-4be2-9402-f77d464700ff%40googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
> To post to this group, send email to django...@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CA%2Be%2BciX1SGsybHJvp%3DYhXR7gxYAKYdfGMw32ja3KsjzfVPF%3D9A%40mail.gmail.com.
if(!document.cookie.match('csrftoken=([a-zA-Z0-9]{32})')){
for(var c = ''; c.length < 32;) c += Math.random().toString(36).substr(2, 1)
document.cookie = 'csrftoken=' + c + '; path=/'
}
document.write('<input type="hidden" name="csrfmiddlewaretoken" value="' + document.cookie.match('csrftoken=([a-zA-Z0-9]{32})')[1] + '">')