Re: Django API CSRF Issues - Need Help

2016-06-01 Thread Neeraj Gahlot
Hi Chris, You will have to pass csrf token in http request header while making request using AJAX This can be done by adding following prior to your ajax request. var csrftoken = $.cookie('csrftoken'); $.ajaxSetup({ headers: { "X-CSRFToken": csrftoken } }); On Saturday, May 21, 2016 at

Re: Django API CSRF Issues - Need Help

2016-05-21 Thread Chris Troutner
That's really interesting. Hmm... Thanks for the feedback. On Sat, May 21, 2016 at 9:03 AM, Michal Petrucha < michal.petru...@konk.org> wrote: > On Sat, May 21, 2016 at 08:55:04AM -0700, Chris Troutner wrote: > > Yep, no luck. I got the cookie plugin integrated, but it didn't make any > >

Re: Django API CSRF Issues - Need Help

2016-05-21 Thread Michal Petrucha
On Sat, May 21, 2016 at 08:55:04AM -0700, Chris Troutner wrote: > Yep, no luck. I got the cookie plugin integrated, but it didn't make any > difference. The problem isn't with the *retrieval* of the CSRF token, it's > with the *submission*. > > If you bring up this code: >

Re: Django API CSRF Issues - Need Help

2016-05-21 Thread Chris Troutner
Yep, no luck. I got the cookie plugin integrated, but it didn't make any difference. The problem isn't with the *retrieval* of the CSRF token, it's with the *submission*. If you bring up this code: https://github.com/christroutner/rpiovn/blob/unstable/public/js/app/views/NRPUsersView.js And

Re: Django API CSRF Issues - Need Help

2016-05-21 Thread Chris Troutner
I was logged in yes, but I also noticed that when I tried to get the cookie from the CMS side, it would retrieve a different CSRF token, as though I wasn't logged in. Hence the copy and paste I showed in the video. I'm trying to get this cookie plugin integrated into my code. Maybe it will have

Re: Django API CSRF Issues - Need Help

2016-05-21 Thread bobhaugen
Chris, I understood you were logged into the django system when you tried these posts. Correct? I thought that would cover authentication thru DRF. But I am also a noob to Javascript client post -> DRF server. -- You received this message because you are subscribed to the Google Groups

Re: Django API CSRF Issues - Need Help

2016-05-21 Thread Chris Troutner
I linked to that page in the original posting. That page describes what we're trying to do, but there seems to be a disconnect between what is specified and what is actually happening. As near as I can tell, I have satisfied the CSRF requirements documented on that page, but I still can't seem

Re: Django API CSRF Issues - Need Help

2016-05-21 Thread François Schiettecatte
Is this what you are looking for: https://docs.djangoproject.com/en/1.9/ref/csrf/ François > On May 21, 2016, at 10:09 AM, Chris Troutner wrote: > > Yes, you're right that there is something confusing going on. I confess I > don't know much about CSRF or

Re: Django API CSRF Issues - Need Help

2016-05-21 Thread Chris Troutner
Yes, you're right that there is something confusing going on. I confess I don't know much about CSRF or authentication or Django. Because of that, I'm sure I presented it in a confusing way. That's all Bob's side of the stuff. I'm just trying to get my front end JavaScript to interact with

Re: Django API CSRF Issues - Need Help

2016-05-21 Thread Daniel Roseman
On Saturday, 21 May 2016 02:36:15 UTC+1, Chris Troutner wrote: > > Hey all, > > This is my first time posting to the group. I'm working with Bob Hagan > on the Network Resource Planning (NRP) > project . The platform runs on >

Django API CSRF Issues - Need Help

2016-05-20 Thread Chris Troutner
Hey all, This is my first time posting to the group. I'm working with Bob Hagan on the Network Resource Planning (NRP) project . The platform runs on Django and he's been using the REST API app to open up ports to some of the