overview #

wsgitools is a set of tools working with WSGI (see PEP 333). It includes classes for filtering content, middlewares for caching, logging and tracebacks as well as two backends for SCGI. Goals in writing it were portability and simplicity.

getting wsgitools #

You can either download version 0.3.1 (signature) or get the latest version from the git repository. Just type git clone git:// The source is also exported using gitweb.

documentation #

Modules are documented using docstrings, so there is an epydoc export.

example #

Most often a simple example is useful. Well here is one:

import sys
from wsgitools.applications import StaticContent
from wsgitools.middlewares import TracebackMiddleware
from wsgitools.filters import WSGIFilterMiddleware, RequestLogWSGIFilter
from wsgitools.scgi.asynchronous import SCGIServer

app = StaticContent("200 OK", [("Content-type", "text/plain")],
    b"""Serving really simple static content as plaintext.""")

# serve a traceback when catching exceptions
app = TracebackMiddleware(app)

# log requests in apache log file format to stdout
app = WSGIFilterMiddleware(app, RequestLogWSGIFilter.creator(sys.stdout))

# run a scgi server on localhost:4000
server = SCGIServer(app, 4000)

recent changes #

contact #

You can mail to, but do not mail Otherwise bug me (helmut) on or OFTC.

Created with Vim

Valid XHTML 1.0!

Valid CSS!

Viewable With Any Browser