Re: how to call django web page with ordinary html page

2014-08-30 Thread Collin Anderson
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

Re: how to call django web page with ordinary html page

2014-08-29 Thread Babatunde Akinyanmi
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

Re: how to call django web page with ordinary html page

2014-08-29 Thread James Schneider
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

Re: how to call django web page with ordinary html page

2014-08-29 Thread Pawan Soni
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

Re: how to call django web page with ordinary html page

2014-08-29 Thread Babatunde Akinyanmi
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"> > > > > >

Re: how to call django web page with ordinary html page

2014-08-29 Thread Matt Gushee
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

Re: how to call django web page with ordinary html page

2014-08-29 Thread Shubham Pansari
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/ .

how to call django web page with ordinary html page

2014-08-29 Thread Pawan Soni
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.