Django, Json and Android

183 views
Skip to first unread message

Kevin Anthony

unread,
Aug 11, 2011, 9:13:13 PM8/11/11
to django...@googlegroups.com
i'm trying to interface a django json page with an android application.
it seems most json applications written for android use
www.somepage.com/json.php?this=that&something=anotherthing

But that doesn't work with django,

Has anyone interfaced Django and Android? and if they did, is there
any reading material on it?

--
Thanks
Kevin Anthony
www.NoSideRacing.com

Gelonida N

unread,
Aug 12, 2011, 5:29:02 AM8/12/11
to django...@googlegroups.com
On 08/12/2011 03:13 AM, Kevin Anthony wrote:
> i'm trying to interface a django json page with an android application.
> it seems most json applications written for android use
> www.somepage.com/json.php?this=that&something=anotherthing
>
> But that doesn't work with django,
>
> Has anyone interfaced Django and Android? and if they did, is there
> any reading material on it?
>

It might help if you were a little more specific. and gave some kind of
example.

What exactly do you mean with 'json' page?

an asynchronous get request to fetch json data or do you mean JSONRPC?

Django can well obtain the values of 'this' and of 'something' in a get
request.

with request.GET.get('this', '-')
and
reuest.GET.get('something', '-')

( but probably this is not what you meant)


Daniel Roseman

unread,
Aug 12, 2011, 6:01:39 AM8/12/11
to django...@googlegroups.com
Your post is a little confusing.

Firstly, URLs of that form (without the .php, of course) work perfectly well in Django. GET parameters are available within the view from `request.GET['this']` etc.

Secondly, however, there is no correlation between the way you request a page and the type of content. In other words, it is just as possible to serve a page as JSON with the url somepage.com/json/this/that/something/anotherthing as it is with somepage.com/json?this=that&something=anotherthing. All that matters is how the server renders the result, and (preferably) declares the content-type when serving it.

Thirdly, none of this has anything to do with Android, since all you are doing from Android is requesting a URL and processing the result.
--
DR.
Reply all
Reply to author
Forward
0 new messages