Skip to main content

An asynchronous session backend with mongodb for tornado.

Project description

Torsession is an asynchronous session backend with Mongodb for Tornado.

Installation

$ pip install torsession

Example

# Initialize SessionManager
sm = SessionManager(motor.MotorClient())

# create a new session or load a session
session = yield sm.new_session()
session = yield sm.load_session("session id")

# set a key-value pair
yield session.set(key, val)

# get key
val = yield session.get(key)

# delete a key
yield session.delete(key)

# refresh session id
yield session.refresh_id()

# clear a session
yield session.clear()

LICENSE

MIT

Project details


Download files

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

Source Distribution

torsession-0.2.3.tar.gz (2.8 kB view hashes)

Uploaded Source

Built Distribution

torsession-0.2.3-py2.7.egg (4.4 kB view hashes)

Uploaded Source

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