MCPcopy
hub / github.com/django/django / _get_storage_path

Method _get_storage_path

django/contrib/sessions/backends/file.py:29–45  ·  view source on GitHub ↗
(cls)

Source from the content-addressed store, hash-verified

27
28 @classmethod
29 def _get_storage_path(cls):
30 try:
31 return cls._storage_path
32 except AttributeError:
33 storage_path = (
34 getattr(settings, "SESSION_FILE_PATH", None) or tempfile.gettempdir()
35 )
36 # Make sure the storage path is valid.
37 if not os.path.isdir(storage_path):
38 raise ImproperlyConfigured(
39 "The session storage path %r doesn't exist. Please set your"
40 " SESSION_FILE_PATH setting to an existing directory in which"
41 " Django can store session data." % storage_path
42 )
43
44 cls._storage_path = storage_path
45 return storage_path
46
47 def _key_to_file(self, session_key=None):
48 """

Callers 3

__init__Method · 0.95
clear_expiredMethod · 0.80

Calls 1

Tested by 1