GAE や Google Closure Library などの話題を扱います。python 初心者です。

2010年1月12日火曜日

GAE 開発開始 - HelloWorld

このエントリーをブックマークに追加 このエントリーを含むはてなブックマーク
GAE開発開始。以下 Mac OS X v10.6でのメモ。

アカウントは以前申し込んでおいたものを使用。

Google App Engine - Google Code


ログイン後に SDKをダウンロード
Downloads - Google App Engine - Google Code


適当なところへコピー。


実行。

これを使って簡易サーバを立ち上げ、ローカルでの開発、デプロイなどが行える。

ドキュメント Hello, World! を元にまずは HelloWorldを表示させる。
Hello, World! - Google App Engine - Google Code

/Users/hashi/development/GAE/helloworld を作成し、そこへドキュメントで紹介されていた2つのファイルを設置する(全部コピぺ)。
helloworld.py

print 'Content-Type: text/plain'
print ''
print 'Hello, world!'


app.yaml

application: helloworld
version: 1
runtime: python
api_version: 1

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


GAEのランチャを起動し、メニューから New Application... を選択。

先程作ったフォルダを指定。

登録されたら "Run" で起動させる。

"Browse"ボタンを押すと Safari が立ち上がり、ターゲットのページを開いてくれる。

出た。最初の一歩終わり。

0 件のコメント:

コメントを投稿