python为什么不能开发移动端_是否可以使用python支持的框架Django开发本机移动应用程序的后端?...

I want to develop a online mobile app. I am thinking about using native languages to develop the front-ends, so Java for Android and Objective-C for iOS. However, for the back-end, can I use something like Django?

I have used django for a while, but the tutorials are really lacking, so can anyone point me to something that will help me understand how to show data handled by Django models on a front-end developed by Java for an android device (that is, by using XML I suppose).

解决方案

Of course you can. Mobile apps, like browsers, are just clients, or specifically you can think of them as specialized browsers that can give a more native look.

It really depends on what kind of mobile app you want to develop, but you said you want a native mobile app. This will mean your mobile app will consume a Web API of some sorts. There is a Django package called Django REST Framework that can help you with that.

Basically, in a native mobile app, you will use whatever HTTP client the SDK comes with to interface with the Web API. That HTTP Client sends a request to Web API, Web API (can be written in Java/Python/Ruby etc) then processes that request and returns a response. That response will then be handled by your native mobile app, either to display some info or messages or whatever you want it to do.

On a more personal note, I recommend you stay away from XML unless you absolutely need to. JSON is enough for a lot of cases, and it is much much simpler.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值