If it helps, you can read/set the csrf cookie using javascript. here's some
rough code:
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
On 30 Aug 2014 07:15, "James Schneider" 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.
>
> Unles
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
q
On Friday, August 29, 2014 5:47:19 PM UTC+5:30, Shubham Pansari wrote:
>
> You are missing csrf_token which is set by request for csrf verification.
> After the line
> http://127.0.0.1:8000/test/"; method="post">
> in your code put {%csrf_token%} and it should work fine and also read why
> it
Why are you adding a csrf token in your context?
On 29 Aug 2014 13:05, "Pawan Soni" wrote:
> Hi ,
>
> i have a simple html page,*p.html *which is not made in django
> application ,its just a ordinary html page which look like..
>
>
>
> http://127.0.0.1:8000/test/"; method="post">
>
>
>
>
>
On Fri, Aug 29, 2014 at 6:16 AM, Shubham Pansari
wrote:
> You are missing csrf_token which is set by request for csrf verification.
> After the line
> http://127.0.0.1:8000/test/"; method="post">
> in your code put {%csrf_token%} and it should work fine
I'm a Django newbie, so I could well be mis
You are missing csrf_token which is set by request for csrf verification.
After the line
http://127.0.0.1:8000/test/"; method="post">
in your code put {%csrf_token%} and it should work fine and also read why
it didnot worked without it from
https://docs.djangoproject.com/en/dev/ref/contrib/csrf/ .
Hi ,
i have a simple html page,*p.html *which is not made in django application
,its just a ordinary html page which look like..
http://127.0.0.1:8000/test/"; method="post">
In form's action i am passing the path of my django url..
this is my *urls.py* file..
from django.conf.
8 matches
Mail list logo