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
Release history Release notifications | RSS feed
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.5.tar.gz
(2.9 kB
view hashes)
Built Distribution
Close
Hashes for torsession-0.2.5-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1ca0495dad055a77807c2c8b852ccbaa44b21f80c13849f4b09529654dce8d89 |
|
MD5 | 3e65bdf9f4962b7020ea116160c1a6a6 |
|
BLAKE2b-256 | 0f804ac0a799c2926715e3ad1aaa7acc7e838f6b6252a1ff4bc11397e7370957 |