wsgistate 0.4.2
WSGI session and caching middleware.
Session (flup-compatible), caching, memoizing, and HTTP cache control
middleware for WSGI. Supports memory, filesystem, database, and
memcached based backends.
# Simple memoization example:
from wsgistate.memory import memoize
@memoize()
def app(environ, start_response):
start_response('200 OK', [('Content-Type', 'text/plain')])
return ['Hello World!']
if __name__ == '__main__':
from wsgiref.simple_server import make_server
http = make_server('', 8080, app)
http.serve_forever()
# Simple session example:
from wsgistate.memory import session
@session()
def app(environ, start_response):
session = environ['com.saddi.service.session'].session
count = session.get('count', 0) + 1
session['count'] = count
start_response('200 OK', [('Content-Type', 'text/plain')])
return ['You have been here %d times!
' % count]
if __name__ == '__main__':
from wsgiref.simple_server import make_server
http = make_server('', 8080, app)
http.serve_forever()
| File | Type | Py Version | Uploaded on | Size | # downloads |
|---|---|---|---|---|---|
| wsgistate-0.4.2-py2.4.egg (md5) | Python Egg | 2.4 | 2007-10-23 | 52KB | 885 |
| wsgistate-0.4.2-py2.5.egg (md5) | Python Egg | 2.5 | 2007-10-23 | 51KB | 805 |
| wsgistate-0.4.2.tar.bz2 (md5) | Source | 2007-10-23 | 14KB | 582 | |
| wsgistate-0.4.2.tar.gz (md5) | Source | 2007-10-23 | 15KB | 589 | |
| wsgistate-0.4.2.win32.exe (md5) | MS Windows installer | any | 2007-10-23 | 86KB | 249 |
| wsgistate-0.4.2.zip (md5) | Source | 2007-10-23 | 28KB | 523 | |
- Author: L. C. Rees
- Home Page: http://pypi.python.org/pypi/wsgistate/
- Keywords: WSGI session caching persistence memoizing HTTP Web
- License: BSD
- Categories
- Package Index Owner: lcrees
- DOAP record: wsgistate-0.4.2.xml
