wiki:jazz/10-12-20

2010-12-20

Google App Engine (Python)

  • 曾經於 2009-05-18 玩過 Java 版的 Google App Engine,今天因為有人問問題,所以就玩了一下 Python 版的 Google App Engine。
  • [感想] 既然 Python 版的 Google App Engine 裡面有放一些 Python 原始碼,或許 AppScale 也就是基於這些程式碼,讓使用者可以去實作一個自己的 Google App Engine。
  • http://code.google.com/intl/zh-TW/appengine/docs/python/
  • 下載:Python 專用的 Google 應用服務引擎 SDK 1.4.0 - 2010-12-02
  • [注意] 由於需要使用 Python 2.5 的環境,若在 Python 2.6 環境下執行會有錯誤,目前比較簡單的方法是用 Debian lenny 去執行會比較簡單,至於 Ubuntu 10.04 的話,因為預設安裝的是 Python 2.6 要改會有點麻煩。
    /tmp$ wget http://googleappengine.googlecode.com/files/google_appengine_1.4.0.zip
    /tmp$ unzip google_appengine_1.4.0.zip
    /tmp$ mkdir -p helloworld
    /tmp$ cat > helloworld/helloworld.py << EOF
    print 'Content-Type: text/plain'
    print ''
    print 'Hello, world!'
    EOF
    /tmp$ cat > helloworld/app.yaml << EOF
    application: helloworld
    version: 1
    runtime: python
    api_version: 1
    
    handlers:
    - url: /.*
      script: helloworld.py
    EOF
    /tmp$ ./google_appengine/dev_appserver.py helloworld/
    
Last modified 13 years ago Last modified on Dec 24, 2010, 9:21:50 AM