summaryrefslogtreecommitdiff
path: root/django/contrib/sessions/backends/cache.py
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2012-10-30 21:59:23 +0100
committerAymeric Augustin <aymeric.augustin@m4x.org>2012-10-31 09:46:16 +0100
commit146ed13a111c97c1c04902a6c0eda1e4ee6e604c (patch)
treebf8c882655e1d5321448088fff0c8d5cf54f3fc0 /django/contrib/sessions/backends/cache.py
parent68847135bc9acb2c51c2d36797d0a85395f0cd35 (diff)
downloaddjango-146ed13a111c97c1c04902a6c0eda1e4ee6e604c.tar.gz
Fixed #17083 -- Allowed sessions to use non-default cache.
Diffstat (limited to 'django/contrib/sessions/backends/cache.py')
-rw-r--r--django/contrib/sessions/backends/cache.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/django/contrib/sessions/backends/cache.py b/django/contrib/sessions/backends/cache.py
index 1b4906f923..596042fcb3 100644
--- a/django/contrib/sessions/backends/cache.py
+++ b/django/contrib/sessions/backends/cache.py
@@ -1,5 +1,6 @@
+from django.conf import settings
from django.contrib.sessions.backends.base import SessionBase, CreateError
-from django.core.cache import cache
+from django.core.cache import get_cache
from django.utils.six.moves import xrange
KEY_PREFIX = "django.contrib.sessions.cache"
@@ -10,7 +11,7 @@ class SessionStore(SessionBase):
A cache-based session store.
"""
def __init__(self, session_key=None):
- self._cache = cache
+ self._cache = get_cache(settings.SESSION_CACHE_ALIAS)
super(SessionStore, self).__init__(session_key)
@property