Hello, world! | Google App Engine

http://code.google.com/intl/ja/appengine/docs/python/gettingstarted/helloworld.html

こちらは、このままなので特に
以下のようにディレクトリ作成。
C:\apps\helloworld
その中に

簡単なリクエスト ハンドラの作成
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

の2ファイルを作成。

アプリケーションのテスト
コマンドプロンプトから、ここだけ、pathの設定をしていないので、全部フルパスで書くとこんな感じです。

c:\>"Program Files\Python27\python.exe" "C:\Program Files\Google\google_appengine\dev_appserver.py" C:\apps\helloworld
INFO     2011-05-03 07:20:57,961 appengine_rpc.py:158] Server: appengine.google.com
INFO     2011-05-03 07:20:57,970 appcfg.py:437] Checking for updates to the SDK.
INFO     2011-05-03 07:21:10,408 appcfg.py:454] The SDK is up to date.
WARNING  2011-05-03 07:21:10,410 datastore_file_stub.py:655] Could not read data
store data from c:\users\junichi\appdata\local\temp\dev_appserver.datastore
INFO     2011-05-03 07:21:10,420 rdbms_sqlite.py:58] Connecting to SQLite databa
se '' with file 'c:\\users\\junichi\\appdata\\local\\temp\\dev_appserver.rdbms'
WARNING  2011-05-03 07:21:10,443 dev_appserver.py:4394] Could not initialize ima
ges API; you are likely missing the Python "PIL" module. ImportError: No module
named _imaging
INFO     2011-05-03 07:21:10,456 dev_appserver_main.py:543] Running application
helloworld on port 8080: http://localhost:8080
INFO     2011-05-03 07:21:18,489 dev_appserver.py:3951] "GET / HTTP/1.1" 200 -
INFO     2011-05-03 07:21:18,753 dev_appserver.py:3951] "GET /favicon.ico HTTP/1
.1" 200 -

以前利用していたものが残っているのでwarningが出ていますがそのままで。

ブラウザから

http://localhost:8080/


Hello, world!
が表示されます!
helloworld.pyのhello world部を変えて更新するとちゃんと更新されます。

Google App Engine Launcher
開発環境の実行からデプロイまで出来ます。

This entry was posted on 火曜日, 5月 3rd, 2011 at 4:27 PM and is filed under Google App Engine, Python. You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.

Unityによるゲームを公開しております iOS/Android
https://itunes.apple.com/jp/app/lost-knight-3d-action/id900917032
https://play.google.com/store/apps/details?id=com.groundroad.runknight

各種開発支援・機能開発等小さいお仕事などもお請けしております。
unity開発支援, PHPシステム開発, javascript/html5 フロント開発, titanium mobileアプリ開発
お気軽にお問い合わせください
大崎・五反田近郊での対面でのお打ち合わせはいつでも可能です。