summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2008-03-20 06:43:58 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2008-03-20 06:43:58 +0000
commit9e47cc2e518cf14a55845b65007fabe8a6b00da7 (patch)
tree2aa6c73c2b96f39f83ac1b60b9484e40721fea3e /django
parent6417f5247b98d5457d5b62c313cd8e1edeaa5e63 (diff)
Fixed #5507 -- Use a more portable way to get at the system's tmpdir (fixes a
problem with the default on Windows). Thanks, Philippe Raoult. git-svn-id: http://code.djangoproject.com/svn/django/trunk@7329 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django')
-rw-r--r--django/conf/global_settings.py2
-rw-r--r--django/contrib/sessions/backends/file.py4
2 files changed, 4 insertions, 2 deletions
diff --git a/django/conf/global_settings.py b/django/conf/global_settings.py
index 6be789a853..3917d40943 100644
--- a/django/conf/global_settings.py
+++ b/django/conf/global_settings.py
@@ -287,7 +287,7 @@ SESSION_COOKIE_PATH = '/' # The path of the sessio
SESSION_SAVE_EVERY_REQUEST = False # Whether to save the session data on every request.
SESSION_EXPIRE_AT_BROWSER_CLOSE = False # Whether sessions expire when a user closes his browser.
SESSION_ENGINE = 'django.contrib.sessions.backends.db' # The module to store session data
-SESSION_FILE_PATH = '/tmp/' # Directory to store session files if using the file session module
+SESSION_FILE_PATH = None # Directory to store session files if using the file session module. If set to None the backend will use a sensible default.
#########
# CACHE #
diff --git a/django/contrib/sessions/backends/file.py b/django/contrib/sessions/backends/file.py
index cd3e3d9c75..d65c81c101 100644
--- a/django/contrib/sessions/backends/file.py
+++ b/django/contrib/sessions/backends/file.py
@@ -9,7 +9,9 @@ class SessionStore(SessionBase):
Implements a file based session store.
"""
def __init__(self, session_key=None):
- self.storage_path = getattr(settings, "SESSION_FILE_PATH", tempfile.gettempdir())
+ self.storage_path = getattr(settings, "SESSION_FILE_PATH", None)
+ if not self.storage_path:
+ self.storage_path = tempfile.gettempdir()
# Make sure the storage path is valid.
if not os.path.isdir(self.storage_path):