云计算 频道

Google App Engine Hello World

  【IT168 资讯】1 先注册
http://code.google.com/appengine/

注意输入手机号码时格式为 +86137xxxxxxxx
一个Google 帐号只能发几次, 如果你的号码发送不了, 试着重新注册一个Google 帐号,
我就是这样解决的 另外有些人说只能支持联通, 我的是移动,可以支持 

2 安装 python2.5 :http://www.python.org/ftp/python/2.5/python-2.5.msi
3 安装 Google App Engine SDK : http://code.google.com/appengine/downloads.html
4 将 python和 Google App Engine SDK 的目录加入PATH
环境已经OK 现在开始写 helloworld 项目
5.在你喜欢的地方建一个文件夹 helloworld
6.在文件夹下建以下文件
app.yaml
内容是, 注意 application agi-alvin 是你注册的 application-id 名

Java代码
application: <application-id>
version: 1
runtime: python
api_version: 1

handlers:
- url: /.*
script: hello.py
application: <application-id>
version: 1
runtime: python
api_version: 1

handlers:
- url: /.*
script: hello.py

hello.py

Java代码
print 'Content-Type: text/plain'
print ''
print 'hello world'
print 'Content-Type: text/plain'
print ''
print 'hello world'

运行 dev_appserver.py E:\google_appengine\demos\hello
试一下你的项目

上传
dev_appserver.py E:\google_appengine\demos\hello

<application-id>.appspot.com

在线日志 CPU使用状态 磁盘存储状态, 一切都好了 真是太方便了

0
相关文章