Re: Django phonegap CORS

2015-03-18 Thread Filipe Ximenes
Awesome, sounds good! On Wed, Mar 18, 2015 at 4:57 AM, Florian Auer wrote: > Hello Filipe > > The idea with the inAppBrowser was great. > I allready was using this plugin but not that way > > Solution for me looks like the following: > 1. I'm still using djangorestframework-jwt in the first

Re: Django phonegap CORS

2015-03-18 Thread Florian Auer
Hello Filipe The idea with the inAppBrowser was great. I allready was using this plugin but not that way Solution for me looks like the following: 1. I'm still using djangorestframework-jwt in the first to check the user credentials - token given from server = credentials OK - no token

Re: Django phonegap CORS

2015-03-17 Thread Filipe Ximenes
Hey, I wrote a blog post about CORS and Django with more details about the subject: http://www.vinta.com.br/blog/2015/django-cors.html =) On Fri, Mar 13, 2015 at 5:32 PM, Filipe Ximenes wrote: > Alright, I think I got what you want now. > > The first solution that comes to mind is to perform ev

Re: Django phonegap CORS

2015-03-13 Thread Filipe Ximenes
Alright, I think I got what you want now. The first solution that comes to mind is to perform everything in the browser. That way, you will first perform "window.open()" and then show a "login view" from django server. I don't have any experience with Phonegap, but it seems that this can also hel

Re: Django phonegap CORS

2015-03-13 Thread Florian Auer
Hello Filipe Thank you for the reply. Well the $http object was till now unknown for me.. there we can see how poor my AngularJS knowledge is till now. But as far as i understood the documentation i am not able to bring up a browser window by this that takes over the control of the app. The

Re: Django phonegap CORS

2015-03-13 Thread Filipe Ximenes
You should not be using window.open() to perform requests in Angular. Instead, use Angular $http service for this: https://docs.angularjs.org/api/ng/service/$http With $http you'll be able to send requests with parameters, headers and any configuration you need. On Fri, Mar 13, 2015 at 8:55 AM, F

Re: Django phonegap CORS

2015-03-13 Thread Florian Auer
Thanks to Filipe, the asynchronous request to django is working correctly. A request to the endpoint url results in a JSON response with the token in it. But now I have another gap in my "logic". Inside this angular app the django site is requested via a call like this, to takeover control from

Re: Django phonegap CORS

2015-03-12 Thread Florian Auer
Thank you for your reply Filipe The question behind was: How to implement a cross domain communication between a phonegap App and a django web project You're right I forgot the django site for the server-side headers in my mind. I'll give it a try with the plugin and test how far i come with

Re: Django phonegap CORS

2015-03-11 Thread Filipe Ximenes
Not 100% sure I understood your question, but it seems that you are trying to overcome the CORS only from the frontend side when you should be treating it from the Django side. Could you take a look on this package: https://github.com/ottoyiu/django-cors-headers If it suits your needs, a good idea

Django phonegap CORS

2015-03-11 Thread Florian Auer
Hello I'm am stuck in a problem dealing with an CORS request from a phonegap app to an django application. What I have so far is the following: - a regular django web project - a phonegap app build on angularJS for some settings. - The idea is, that users can use the app to store relevant s