Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

  • Loading branch information...
commit 3530b7e071645a3e0286b1610b170f6859045b71 1 parent a1f0187
@Queatz authored
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,8 +8,14 @@
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,
@@ -17,6 +23,8 @@ class Earthlings:
'tools.staticdir.dir': 'static'
}
+ del sp
+
def __init__(self):
self.stash = markers.Stash()
Please sign in to comment.
Something went wrong with that request. Please try again.