首先是一些运行环境的准备工作
python主页 下载一份最新的python
appengine主页 下载sdk(体积很小,才1m多)
然后,登陆google帐户申请开通使用权限,发条短信而已也很简单,注册一个appspot的二级域名,之后所编写的应用就可以直接上传到这个域名所在的本地目录(一经申请就不能编辑了,但一个帐户可以申请3个)
在d盘新建一个名为liangapp的目录,新增名为app.yaml的配置文件,有点类似rails 。内容如下








然后新建配置文件里对应的liangapp.py文件

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

功能很简单,一目了然。 就是判断当前访问的用户是否已登录google帐户,是的话显示账户名,否则转向登陆页
测试一下看刚写的代码是否能正常工作。打开命令行 输入 dev_appserver.py liangapp --port=8888,成功的话打开ie,输入http://localhost:8888/就可以看到效果了
上传到刚才申请的域名liangapp.appspot.com也很简单, 同样是命令行 appcfg.py liangapp ,输入用户密码就可以了。