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 >

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 the

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 authentication or Django. Bec

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 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 "Django

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 be

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 scrol

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: > https://github.com/chris

about django framework execution sequence

2016-05-21 Thread zeeshan malik
anybody plz tel me the exzact sequence of Djngo framework execution like: first of all url call to view functions and then views render the templates and data will show on page then in case of inserting data in form how djngo execute in sequence how model and form work and how ORM role in map

Django Test Errors

2016-05-21 Thread Yoseph Radding
I apologize as I inadvertently submitted my last post and cant delete it. Any way: I am in the midst of writing unit tests for an application I am working on. My tests work fine on my 2012 Macbook pro but not my 2015 iMac. Both are running the latest OSX and the django version is version 1.9.1

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 > > di

Displaying a document

2016-05-21 Thread Wilfredo Rivera
Hello: I want to display an uploaded file in the browser. My website save the file in the database, but i don't have idea of how can the website display it once the user click on the link. I am new to django and programming in general so i am learning on a trial and error basis. The view that

Re: Displaying a document

2016-05-21 Thread Luis Zárate
Do you have a model with a fileField? I think you are wrong passing file to template, if you have a model with filefield you can use media url something like class Mymodel(Model): myfile = models.FileField(upload_to="my_file_path_in_media") so you can use a form class Myform(forms.Mod

Re: Displaying a document

2016-05-21 Thread Wilfredo Rivera
I think my code is more or less what you said, i made the change in the template to include a link to the uploaded file using the Media_URL variable, but it didn't work. It gave me a page not found error. I don't know if i have to include a URL, the documentation doesn't mention anything. Below

Re: Is it possible to output a graph from Matplotlib into Django like this?

2016-05-21 Thread Yunpeng Pan
This solution makes a lot of sense! On Tuesday, April 12, 2011 at 1:06:55 AM UTC-5, Sam Walters wrote: > > I mis-read this... basically you have one view and in the template you > are rendering you put HTML: > > > > > > so that path will call your other views which return content as > content_ty

Re: Displaying a document

2016-05-21 Thread Luis Zárate
2016-05-21 13:21 GMT-06:00 Wilfredo Rivera : > {{candidate.resumeFile}}" {{candidate.resumeFile.name}} " Looking in your code probably you could be interested in https://docs.djangoproject.com/ja/1.9/ref/class-based-views/generic-editing/ -- "La utopía sirve para caminar" Fernando Birri -