在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 查看執行效果

 



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