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.2.3 or get the latest version from the git repository. Just type git clone git://git.subdivi.de/~helmut/wsgitools.git.
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")],
"""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)
server.run()
recent changes #
- Tue Dec 6 11:08:58 CET 2011: release version 0.2.3
- Wed Nov 2 19:32:08 CET 2011: improved error handling in digest.py and added qop=auth test
- Tue Nov 1 23:43:17 CET 2011: support gentoken without algo in digest.py
- Wed Jun 1 15:30:34 CEST 2011: added test cases and reworked AuthTokenGenerator class
- Wed Jun 1 15:01:14 CEST 2011: switched from darcs to git
- Wed Jan 12 21:41:27 CET 2011: released version 0.2.2 fixing dos and py2.6
- Wed Jan 12 21:37:54 CET 2011: fixed denial of service bugs in StaticContent, CachingMiddleware and scgi.asynchronous
- Sat Sep 4 20:31:10 CEST 2010: CachingMiddleware gained automatic cache pruning
- Thu Sep 2 00:40:24 CEST 2010: improved digest documentation and test suite
- Tue Aug 31 12:34:57 CEST 2010: bugfix: do not use broken io module from py2.6
contact #
You can mail to helmut@subdivi.de, but do not mail devnull@subdivi.de.