在安卓上开发Django应用(通过Qpython)

无聊去整了个安卓的Python运行环境来看,发现真心不错。虽然不能逾越塞班的强大,但是就能运行Django来说,我觉得很赞。于是我百度了很久,差不多 国内没有人做这种事。于是家事问百度,外事问谷歌的思想,果然找到了一种方法,老外说的很全。

问:

Can I run Django in qpython ?

I found that the qpypi has the django library link, how can I use django ?
答:

Yes, you can run django in qpython >= 0.9.4

 

1, install Django/ Wsgiref / Sndhdr / Sqlite 3 from QPypi's QPython libraries catalog.

 

2, install QDjango sample for android from QPypi's QPy Project Samples' catalog.

 

3, Run local project from qpython start button, choose QPyDjango

 

You need to initialize the project as it guide,  it will execute python manage.py syncdb automatically,  then it will start the django's debug web server by executing python manager.py runserver, you can open http://localhost:8000 with browser to browse the site.

 

You can change anything as you want.

 

Now, it only support sqlite as backend.  MySQL backend support need testing.

 

if you failed to import sqlite, please follow the newest step introduction:http://qpython.org/question/336/can-i-use-sqlite-in-qpython/

 

Just enjoy.

 

上文大概意思是,安卓上运行DJango应用需要通过QPython的库安装Django/ Wsgiref / Sndhdr / Sqlite 3等库,然后在Qpytohn官网(pypi.python.org/)下载Django for QPython默认应用就可以在安卓模拟Django应用。

 

————————

表示我在这上面运行时遇到Not permission错误。

posted @ 2014-05-16 21:57  小小Ho  阅读(915)  评论(0)    收藏  举报