Skip to content

~\app.yaml

mirnhoj edited this page Dec 15, 2012 · 9 revisions

This is a required Google App Engine(GAE) configuration file. It contains information about which handler scripts to associate with specific URLs. It also makes certain libraries available to the webapp.


File Dependencies

Files that this file needs

Files that need this file

  • None

Code Details

Required Elements

Application Identifier

To associate the webapp to the URL ploverdojo.appspot.com, we add:

application: ploverdojo

Version Specifier

We can include a version specifier so GAE can do a little version control. But since we're using git/github for our VCS, we don't really need to worry about this. We only add the following because it's required:

version: 1

Runtime Environment

To use the Python 2.7 runtime environment in GAE, we add:

runtime: python27

API Version

The following will indicate which version of the API for the python27 runtime environment is used by our app. At the time of this writing, there is only one version for the python27 runtime environment, so it's pretty pointless albeit required :-p:

api_version: 1

Threadsafe

This will configure our application to use concurrent requests, which is required to be true given our configuration:

threadsafe: true

Handlers

This tells the webapp how certain URLs should be handled:

handlers:
- url: /assets
  static_dir: assets

- url: /css
  static_dir: css

- url: /js
  static_dir: js

- url: /.*
  script: ploverdojo.app

This will tell GAE that URLs containing ploverdojo.appspot.com/assets should point to ~/assets in our project. Similarly, with css and js. The last handler will catch all URLs not caught by the previous handlers and use ploverdojo.py to handle it.

Optional Elements

Libraries:

libraries:
- name: jinja2
  version: latest

This will make the jinja2 templating library available for us to use.


Helpful Links

Information on the app.yaml file

Information on the YAML markup language