First you need to download the following packages
Creating a Simple Request Handler
Create a directory named helloworld
. All files for this application reside in this directory.Inside the helloworld
directory, create a file named helloworld.py
, and give it the following contents:
print 'Content-Type: text/plain' print '' print 'Hello, world!' |
This Python script responds to a request with an HTTP header that describes the
content, a blank line, and the message Hello, world!
.
Creating the Configuration File
An App Engine application has a configuration file called app.yaml
. Among other things, this file describes which handler scripts should be used for which URLs.
Inside the helloworld
directory, create a file named app.yaml
with the following contents:
application: helloworld version: 1 runtime: python api_version: 1 handlers: - url: /.* script: helloworld.py |
Testing the Application
google_appengine/dev_appserver.py helloworld Type the following URL and enjoy! |
Reference
http://code.google.com/appengine/docs/gettingstarted/
No comments:
Post a Comment