Browse files

Use file sessions so the server can restart without breaking anything.

  • Loading branch information...
1 parent a1f0187 commit 3530b7e071645a3e0286b1610b170f6859045b71 @Queatz committed Apr 25, 2012
Showing with 9 additions and 0 deletions.
  1. +1 −0 site/.gitignore
  2. +8 −0 site/backend.py
View
1 site/.gitignore
@@ -1 +1,2 @@
*__pycache__*
+sessions/*
View
8 site/backend.py
@@ -8,15 +8,23 @@
current_dir = os.path.dirname(os.path.abspath(__file__))
class Earthlings:
+ sp = os.path.join(current_dir, 'sessions')
+ if not os.path.isdir(sp):
+ os.mkdir(sp)
+
_cp_config = {
'tools.sessions.on': True,
+ 'tools.sessions.storage_type': 'file',
+ 'tools.sessions.storage_path': sp,
'tools.sessions.timeout': 60 * 24,
'tools.staticdir.on': True,
'tools.staticdir.root': current_dir,
'tools.staticdir.dir': 'static'
}
+ del sp
+
def __init__(self):
self.stash = markers.Stash()

0 comments on commit 3530b7e

Please sign in to comment.