在GAE上用python写helloworld实录

虽然GAE出来很久了,朋友也给我介绍过,但是一直无缘真正接触一下,今天终于有时间安装GAE getting started做了一次Hello World,呵呵,步骤很简单三步。

prerequired : python 2.5 ,GAE-SDK

 

1:建立helloworld 文件夹,例如d:/python/helloworld

 

2:建立Python文件hellowrold.py

 

print 'Content-type:text/plain'

print ''

print 'hello world!'

 

3:在helloworld 文件夹下建立配置文件app.yaml

 

application: helloworld

version: 1

runtime: python

api_version: 1


handlers:

- url: /.*

  script: helloworld.py

4:执行GAE web server,前提是你有吧GAE的SDK的安装路径配置到系统Path中

dev_appserver.py helloworld/ 出现错误

google.appengine.tools.dev_appserver.AppConfigNotFoundError


执行命令改为:dev_appserver.py d:/python/helloworld/即可

 

5:http://localhost:8080 查看执行效果

 



發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章