Please note that the contents of this offline web site may be out of date. To access the most recent documentation visit the online version .
Note that links that point to online resources are green in color and will open in a new window.
We would love it if you could give us feedback about this material by filling this form (You have to be online to fill it)



webapp Overview

Note: This framework is available to Python 2.5 users only. Python 2.7 users should use the webapp2 framework, which is highly compatible with webapp, and should not introduce server backward-compatibility issues. For more information, see Migrating to Python 2.7 .

A web application framework can simplify development by taking care of the details of the interface, letting you focus development effort on your application's features. The App Engine Python 2.5 environment includes a simple web application framework called webapp, which handles requests and allows you to easily build a response.

Using the webapp framework in Python 2.5

App Engine supports Python 2.5 applications with a CGI interface. The Python 2.5 runtime doesn't support a WSGI interface, however it is possible to use WSGI frameworks with the run_wsgi_app CGI adapter provided by the webapp.util package.

Here is a simple webapp application that uses a CGI adapter with App Engine:

from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app

class MainPage(webapp.RequestHandler):
    def get(self):
        self.response.headers['Content-Type'] = 'text/plain'
        self.response.out.write('Hello, webapp World!')

application = webapp.WSGIApplication([('/', MainPage)],
                                     debug=True)

def main():
    run_wsgi_app(application)

if __name__ == "__main__":
    main()

Authentication required

You need to be signed in with Google+ to do that.

Signing you in...

Google Developers needs your permission to do that.