19π
I personally have created multiple native apps with JqueryMobile as my frontend β Django as the server side β and phonegap to natively wrap into a itunes store application. Itβs really a great combination of technologies that β if done correctly β can yield a fast native application.
First of all you should look into Tastypie. Tastypie is a really easy way to create an instant RESful API that can send JSON data to javascript/JQuery. Its a Django app and it is very pythonic (plenty of easy class/method overrides β everything is transparent).
The flow of data transfer would look something like this:
-
Use a jquery.ajax function or a getJSON function to get/post/put JSON data from a specified URL.
-
This URL is the tastypie API created from your Models. it could look like /api/vi/blogs/all/
-
Now you have JSON data in your frontend with Jquery β you can do whatever you want with it β fill in a table β work with forms β etc.
First Check out some Jquery/Jquery mobile ajax functions and how to work with JSON on the frontend with the Jquery library. Secondly get familiar with sending JSON back to a Django view (parsing the data and saving it to the database). Then dive into the specifics of JQuery Mobile User Interface and the steps to get it working well with PhoneGap.
4π
One of the things you will need to look out for is same-origin features built into jquery. Since phonegap uses a a webview withl url file:// any web request you make will be cross domain so you need to configure jquery mobile to allow it.
see http://jquerymobile.com/test/docs/pages/phonegap.html
Other than that, thereβs not much difference between a phonegap mobile application and a regular web app with respect to getting/posting JSON.
- How to properly runserver on different settings for Django?
- Using django models across apps?
- Reverse Queryset Order in Django