webapp2 Web Framework

2.5.2 · abandoned · verified Thu Apr 16

webapp2 is a lightweight Python web framework, designed specifically for Google App Engine's Python 2 standard environment. It extends the original `webapp` framework, providing enhanced routing, session management, and other utilities. The current version is 2.5.2, but the library is no longer actively maintained and does not support Python 3.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates a basic 'Hello, webapp2!' application using a single request handler and a WSGIApplication setup. This code would typically be run within a Google App Engine Python 2 standard environment.

import webapp2

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

app = webapp2.WSGIApplication([
    ('/', MainPage),
], debug=True)

# To run locally with GAE dev server:
# In your app.yaml (or similar) point to this file:
# handlers:
# - url: /.* 
#   script: main.app

view raw JSON →