-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
30 lines (21 loc) · 1.16 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
=== I'm going to move my application to use MongoDB for sessions and probably drop memcached entirely. This project won't be continued by me. ===
This is just a simple library I threw together for getting
sessions working with a tornado app I'm working on, using
memcached as a backend.
It does require the memcache library, I had trouble getting the
c based one to work. Change the import at the top if you're using
another memcached interface. It also depends on Tornado
Basic usage is
import sessions
class MainHandler(tornado.web.RequestHandler):
def get(self):
self.session = sessions.Session(req_obj = self)
... (do stuff)
self.session would be a dictionary object. However, because python doesn't
bubble changes up through dictionary like objects, you'd be smart to
get into the habit of closing every session based request with
self.session.save()
I'm working on a request methodlogy for my application whereby I may be able
to automate this, and will try to remember to update this documenation with
the approach when that's complete.
I'm not offering any support for this, and it's entirely public domain. Do with it as you wish, and do so at your own risk.