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.1 or get the latest version from the darcs repository. Just type darcs get http://subdivi.de/~helmut/darcs/wsgitools/.
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 #
- Fri Jun 4 21:57:17 CEST 2010: flush log file in RequestLogWSGIFilter by default
- Sat May 29 00:49:15 CEST 2010: released version 0.2.1 fixing a security issue in RequestLogWSGIFilter
- Tue May 25 23:30:02 CEST 2010: two small bug fixes
- Sat Jul 4 00:41:47 CEST 2009: released version 0.2. Quite some things were added, improved or just bugfixed. Notable additions are a small testsuite and digest.DBAPI2NonceStore.
- Mon Sep 22 19:07:33 CEST 2008: added applications.StaticFile
- Mon Sep 22 12:29:31 CEST 2008: added nonce storage interface for digest auth (and some doc string improvements)
- Fri Sep 19 12:43:52 CEST 2008: added ReusableWSGIInputFilter
- Tue Sep 9 19:09:11 CEST 2008: BasicAuthMiddleware improvements
- Sat Jul 12 15:07:46 CEST 2008: some bugfixes and docstring changes
- Tue Jul 8 22:01:31 CEST 2008: many important scgi.forkpool fixes, other bugfixes and minor features
contact #
You can mail to helmut@subdivi.de, but do not mail devnull@subdivi.de.