{ "info": { "author": "Gerard Monells", "author_email": "gerard.monells@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "===========\nWSGISession\n===========\n\nWSGISession provides an easy way to deal with sessions in any WSGI\ncompilant application. This middleware is useful always you want to\nstore user sessions of a user, understanding that this user will store\nthe session id in a cookie. It's up to you how to save and retrieve\nthe session object.\n\nIn order to do so, we offer the middleware and the session object, but\nyou need to provide the session factory object, whose role is to save\nand retrieve sessions from wherever they are. Here's an example:\n\n #!/usr/bin/env python\n\n from wsgiref.simple_server import make_server\n from wsgisession import SessionMiddleware\n\n\n class ExampleFactory(object):\n def load(self, id=None):\n session = Session()\n # whatever needed to retireve session object\n session.data = {'dummy': 'key'}\n session.id = '123'\n return session\n\n def save(self, session):\n # save the session.data, possibly generating session.id\n return session.id\n\n\n def wrapped_app(environ, start_response):\n session = environ.get('wsgisession')\n session['counter'] = session.get('counter', 0) + 1\n start_response('200 OK', [('Content-Type', 'text/html')])\n return 'Visited %s times\\n' % session['counter']\n\n factory = ExampleFactory()\n app = SessionMiddleware(wrapped_app, factory)\n\n if __name__ == '__main__':\n httpd = make_server('localhost', 8080, app)\n httpd.serve_forever()", "description_content_type": null, "docs_url": null, "download_url": "http://pypi.python.org/pypi/WSGISession/", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Sirtea/WSGISession", "keywords": null, "license": "MIT license", "maintainer": null, "maintainer_email": null, "name": "WSGISession", "package_url": "https://pypi.org/project/WSGISession/", "platform": "any", "project_url": "https://pypi.org/project/WSGISession/", "project_urls": { "Download": "http://pypi.python.org/pypi/WSGISession/", "Homepage": "https://github.com/Sirtea/WSGISession" }, "release_url": "https://pypi.org/project/WSGISession/0.1.0/", "requires_dist": null, "requires_python": null, "summary": "WSGI sessions implentation (session id in a cookie).", "version": "0.1.0" }, "last_serial": 785976, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "a1c36f2a6c7f16a57a0f9ddd4d7956d8", "sha256": "f41df3abc2fb2d9ffe6dfcd48e264fad63a40041c94839802f5bc87ca2f22526" }, "downloads": -1, "filename": "WSGISession-0.1.0.tar.gz", "has_sig": false, "md5_digest": "a1c36f2a6c7f16a57a0f9ddd4d7956d8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2970, "upload_time": "2013-02-04T14:11:42", "url": "https://files.pythonhosted.org/packages/ae/13/821c4e7c35f5f9c79c2d5398758445941ae22d6322a72a2cae3d6ec64f1e/WSGISession-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a1c36f2a6c7f16a57a0f9ddd4d7956d8", "sha256": "f41df3abc2fb2d9ffe6dfcd48e264fad63a40041c94839802f5bc87ca2f22526" }, "downloads": -1, "filename": "WSGISession-0.1.0.tar.gz", "has_sig": false, "md5_digest": "a1c36f2a6c7f16a57a0f9ddd4d7956d8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2970, "upload_time": "2013-02-04T14:11:42", "url": "https://files.pythonhosted.org/packages/ae/13/821c4e7c35f5f9c79c2d5398758445941ae22d6322a72a2cae3d6ec64f1e/WSGISession-0.1.0.tar.gz" } ] }