Skip to page content Skip to main navigation
English | Site Directory

e.g. "templates" or "datastore"

# webapp Overview

App Engine supports any Python application with a CGI interface. A web application framework can simplify development by taking care of the details of the interface, letting you focus development effort on your applications features. App Engine includes a simple web application framework called webapp.

webapp is a WSGI-compatible framework. You can use webapp or any other WSGI framework with App Engine using a CGI adaptor, such as one provided by the Python standard library.

Here is a simple webapp application that uses a CGI adaptor 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()