This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

WSGISession provides an easy way to deal with sessions in any WSGI compilant application. This middleware is useful always you want to store user sessions of a user, understanding that this user will store the session id in a cookie. It’s up to you how to save and retrieve the session object.

In order to do so, we offer the middleware and the session object, but you need to provide the session factory object, whose role is to save and retrieve sessions from wherever they are. Here’s an example:

#!/usr/bin/env python

from wsgiref.simple_server import make_server from wsgisession import SessionMiddleware

class ExampleFactory(object):
def load(self, id=None):
session = Session() # whatever needed to retireve session object = {‘dummy’: ‘key’} = ‘123’ return session
def save(self, session):
# save the, possibly generating return
def wrapped_app(environ, start_response):
session = environ.get(‘wsgisession’) session[‘counter’] = session.get(‘counter’, 0) + 1 start_response(‘200 OK’, [(‘Content-Type’, ‘text/html’)]) return ‘Visited %s timesn’ % session[‘counter’]

factory = ExampleFactory() app = SessionMiddleware(wrapped_app, factory)

if __name__ == ‘__main__’:
httpd = make_server(‘localhost’, 8080, app) httpd.serve_forever()
Release History

Release History


This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
WSGISession-0.1.0.tar.gz (3.0 kB) Copy SHA256 Checksum SHA256 Source Feb 4, 2013

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting