Skip to main content

WSGI session and caching middleware.

Project description

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()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

wsgistate-0.4.2.zip (29.6 kB view details)

Uploaded Source

wsgistate-0.4.2.tar.gz (15.8 kB view details)

Uploaded Source

wsgistate-0.4.2.tar.bz2 (14.4 kB view details)

Uploaded Source

Built Distributions

wsgistate-0.4.2.win32.exe (88.8 kB view details)

Uploaded Source

wsgistate-0.4.2-py2.5.egg (52.7 kB view details)

Uploaded Source

wsgistate-0.4.2-py2.4.egg (53.8 kB view details)

Uploaded Source

File details

Details for the file wsgistate-0.4.2.zip.

File metadata

  • Download URL: wsgistate-0.4.2.zip
  • Upload date:
  • Size: 29.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for wsgistate-0.4.2.zip
Algorithm Hash digest
SHA256 04f4e2c08d7bd5a20100b94d84a4dbe989190da787caf487e46f296bec0771c5
MD5 75c67a3c567d0d6ea43d9b954720f0e9
BLAKE2b-256 97cc67867aeda868449b7176252006b0ffa3db409a3333a663027e0c1213715c

See more details on using hashes here.

File details

Details for the file wsgistate-0.4.2.tar.gz.

File metadata

  • Download URL: wsgistate-0.4.2.tar.gz
  • Upload date:
  • Size: 15.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for wsgistate-0.4.2.tar.gz
Algorithm Hash digest
SHA256 d27f829d9fa66b3309aee801248022cf964380e2f84b25be1f6df73203c9b95d
MD5 431608c2de0be9e9b69bb02cf57e1019
BLAKE2b-256 4c2b048466c7ee8f0acc904348d9f289253b9a09f4d7d5d27185e4a0d131ebb5

See more details on using hashes here.

File details

Details for the file wsgistate-0.4.2.tar.bz2.

File metadata

  • Download URL: wsgistate-0.4.2.tar.bz2
  • Upload date:
  • Size: 14.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for wsgistate-0.4.2.tar.bz2
Algorithm Hash digest
SHA256 d1ac7af6be68c561398c7ed7adb05ce6a0a8fa9f4976bc3badbe051dd0b80342
MD5 c0ebc7ebd2e74ff5cccabf7df9508da0
BLAKE2b-256 9684ebe68bdc797db9ea60ab13d48510c171517812b201b282afa4961cea996d

See more details on using hashes here.

File details

Details for the file wsgistate-0.4.2.win32.exe.

File metadata

File hashes

Hashes for wsgistate-0.4.2.win32.exe
Algorithm Hash digest
SHA256 de01404dfb92790dfebcd361551dfac7e349f719c25edfbfa3dc53d905968734
MD5 d86951e59036f0718d7a940532c2a625
BLAKE2b-256 44cef2e41b3634f4712ce980a564a37d4b6a97b4a6db76d32744d3b1016edf0a

See more details on using hashes here.

File details

Details for the file wsgistate-0.4.2-py2.5.egg.

File metadata

File hashes

Hashes for wsgistate-0.4.2-py2.5.egg
Algorithm Hash digest
SHA256 d0f96787f80bcb51e5e685583f7aa33d1eb3aaf9ad49794899d1f26a59d5d7e9
MD5 07b63d2eeae3619f4194525bcd2a1174
BLAKE2b-256 06b2128bd3ae76f5d8bfacc492098f0429f586f4e71a93e2b63f0f9a4a2f972a

See more details on using hashes here.

File details

Details for the file wsgistate-0.4.2-py2.4.egg.

File metadata

File hashes

Hashes for wsgistate-0.4.2-py2.4.egg
Algorithm Hash digest
SHA256 23be88efd0f36e19ff569070930da9fb484304233487f1a9d750aa044a46e1cb
MD5 f831a000f3ac429d581ecb59a9f722be
BLAKE2b-256 19b6ac8c1c9efd99f5c0205ea42db36908cb72522ca5008f481ee5993e444c47

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page