Django

Code

Changeset 7329

Show
Ignore:
Timestamp:
03/20/08 01:43:58 (5 months ago)
Author:
mtredinnick
Message:

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.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/conf/global_settings.py

    r7185 r7329  
    288288SESSION_EXPIRE_AT_BROWSER_CLOSE = False                 # Whether sessions expire when a user closes his browser. 
    289289SESSION_ENGINE = 'django.contrib.sessions.backends.db'  # The module to store session data 
    290 SESSION_FILE_PATH = '/tmp/'                             # Directory to store session files if using the file session module 
     290SESSION_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. 
    291291 
    292292######### 
  • django/trunk/django/contrib/sessions/backends/file.py

    r7294 r7329  
    1010    """ 
    1111    def __init__(self, session_key=None): 
    12         self.storage_path = getattr(settings, "SESSION_FILE_PATH", tempfile.gettempdir()) 
     12        self.storage_path = getattr(settings, "SESSION_FILE_PATH", None) 
     13        if not self.storage_path: 
     14            self.storage_path = tempfile.gettempdir() 
    1315 
    1416        # Make sure the storage path is valid. 
  • django/trunk/docs/sessions.txt

    r7294 r7329  
    4949``"django.contrib.sessions.backends.file"``. 
    5050 
    51 You might also want to set the ``SESSION_FILE_PATH`` setting (which 
    52 defaults to ``/tmp``) to control where Django stores session files. Be 
    53 sure to check that your Web server has permissions to read and write to 
    54 this location. 
     51You might also want to set the ``SESSION_FILE_PATH`` setting (which defaults 
     52to output from ``tempfile.gettempdir()``, most likely  ``/tmp``) to control 
     53where Django stores session files. Be sure to check that your Web server has 
     54permissions to read and write to this location. 
    5555 
    5656Using cache-based sessions