summaryrefslogtreecommitdiff
path: root/example_project/settings.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2017-08-28 15:04:11 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2017-08-28 15:04:11 +0200
commit2ab574a7ee938ba6da935cbc3acac35778cb7db1 (patch)
treeebff5140460e904423c3722ec5d38c804ab4b944 /example_project/settings.py
parentd5f25174cbe34d5370991dade87662b79031fca1 (diff)
downloadIshtar-2ab574a7ee938ba6da935cbc3acac35778cb7db1.tar.bz2
Ishtar-2ab574a7ee938ba6da935cbc3acac35778cb7db1.zip
Performance: keep db connection - cache sessions
Diffstat (limited to 'example_project/settings.py')
-rw-r--r--example_project/settings.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/example_project/settings.py b/example_project/settings.py
index 2d19cacc6..c9abdf9f5 100644
--- a/example_project/settings.py
+++ b/example_project/settings.py
@@ -304,3 +304,9 @@ if SQL_DEBUG:
if 'test' in sys.argv:
PROJECT_SLUG += "-test"
+
+if not DEBUG:
+ # persistent connection
+ DATABASES['default']['CONN_MAX_AGE'] = 600
+ # session in cache and database
+ SESSION_ENGINE = "django.contrib.sessions.backends.cached_db"