Developing a Python App for Google App Engine
If you are using the Launcher, you can start a new project by selecting the File menu, New Application…. The Launcher creates a new project with several files, which you may wish to edit to follow along with the
example. Alternatively, you can create the project directory and files by hand, then add the project to the Launcher by selecting the File menu, Add Existing Application….
Create a directory named clock to contain the project. Using your favorite text editor, create a file inside this directory named app.yaml.
The app.yaml configuration file for a simple application
– url: /.*
This configuration file is in a format called YAML, an open format for configuration files and network messages. You don’t need to know much about the format beyond what you see here.
In this example, the configuration file tells App Engine that this is version 1 of an application called clock, which uses version 1 of the Python runtime environment (the “API version”). Every request for this application (every URL that matches the regular expression /.*) is to be handled by a Python script named main.py. Create a file named main.py
Example A simple Python request handler script
print ‘Content-Type: text/html’
print ‘<p>The time is: %s</p>’ % str(datetime.datetime.now())