diff options
author | Marcel Hellkamp <marc@gsites.de> | 2014-03-26 10:41:24 +0100 |
---|---|---|
committer | Marcel Hellkamp <marc@gsites.de> | 2014-03-26 10:41:24 +0100 |
commit | dca6a65920ec532d7ed3e22583bb751644d3fb58 (patch) | |
tree | 3f47f4587b376db5f359a09e228cf9b2fbc055e2 | |
parent | 321d47c41def9c202b70f0c44a8a1bee7bee44ce (diff) | |
parent | 5c59ec6116e172d5f762609b3db6e23baa817451 (diff) | |
download | bottle-dca6a65920ec532d7ed3e22583bb751644d3fb58.tar.gz |
Merge pull request #601 from davidwtbuxton/app-engine-docs
Update documentation for App Engine deployments.
-rw-r--r-- | docs/deployment.rst | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/docs/deployment.rst b/docs/deployment.rst index f4b26d9..0551320 100644 --- a/docs/deployment.rst +++ b/docs/deployment.rst @@ -129,11 +129,32 @@ Google AppEngine .. versionadded:: 0.9 -The ``gae`` server adapter is used to run applications on Google App Engine. It works similar to the ``cgi`` adapter in that it does not start a new HTTP server, but prepares and optimizes your application for Google App Engine and makes sure it conforms to their API:: +New App Engine applications using the Python 2.7 runtime environment support any WSGI application and should be configured to use the Bottle application object directly. For example suppose your application's main module is ``myapp.py``:: + + import bottle + + @bottle.route('/') + def home(): + return '<html><head></head><body>Hello world!</body></html>' + + app = bottle.default_app() + +Then you can configure App Engine's ``app.yaml`` to use the ``app`` object like so:: + + application: myapp + version: 1 + runtime: python27 + api_version: 1 + + handlers: + - url: /.* + script: myapp.app + +Bottle also provides a ``gae`` server adapter for legacy App Engine applications using the Python 2.5 runtime environment. It works similar to the ``cgi`` adapter in that it does not start a new HTTP server, but prepares and optimizes your application for Google App Engine and makes sure it conforms to their API:: bottle.run(server='gae') # No need for a host or port setting. -It is always a good idea to let GAE serve static files directly. Here is example for a working ``app.yaml``:: +It is always a good idea to let GAE serve static files directly. Here is example for a working ``app.yaml`` (using the legacy Python 2.5 runtime environment):: application: myapp version: 1 |