Python django.conf.settings.SESSION_CACHE_ALIAS Examples

The following are 12 code examples for showing how to use django.conf.settings.SESSION_CACHE_ALIAS(). These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example.

You may check out the related API usage on the sidebar.

You may also want to check out all available functions/classes of the module django.conf.settings , or try the search function .

Example 1
Project: django-qsessions   Author: QueraTeam   File: models.py    License: MIT License 6 votes vote down vote up
def delete(self):
        """
        Delete sessions from both DB and cache (first cache, then DB)
        """
        # noinspection PyPep8Naming
        SessionStore = Session.get_session_store_class()
        prefix = getattr(SessionStore, "cache_key_prefix", None)
        if prefix is not None:
            caches[settings.SESSION_CACHE_ALIAS].delete_many(prefix + s.session_key for s in self)
        return super(SessionQuerySet, self).delete() 
Example 2
Project: GTDWeb   Author: lanbing510   File: cache.py    License: GNU General Public License v2.0 5 votes vote down vote up
def __init__(self, session_key=None):
        self._cache = caches[settings.SESSION_CACHE_ALIAS]
        super(SessionStore, self).__init__(session_key) 
Example 3
Project: GTDWeb   Author: lanbing510   File: cached_db.py    License: GNU General Public License v2.0 5 votes vote down vote up
def __init__(self, session_key=None):
        self._cache = caches[settings.SESSION_CACHE_ALIAS]
        super(SessionStore, self).__init__(session_key) 
Example 4
Project: django-qsessions   Author: QueraTeam   File: models.py    License: MIT License 5 votes vote down vote up
def delete(self, *args, **kwargs):
        """
        Delete session from both DB and cache (first cache, then DB)
        """
        # noinspection PyPep8Naming
        SessionStore = Session.get_session_store_class()
        prefix = getattr(SessionStore, "cache_key_prefix", None)
        if prefix is not None:
            caches[settings.SESSION_CACHE_ALIAS].delete(prefix + self.session_key)
        return super(Session, self).delete(*args, **kwargs) 
Example 5
Project: bioforum   Author: reBiocoder   File: cache.py    License: MIT License 5 votes vote down vote up
def __init__(self, session_key=None):
        self._cache = caches[settings.SESSION_CACHE_ALIAS]
        super().__init__(session_key) 
Example 6
Project: bioforum   Author: reBiocoder   File: cached_db.py    License: MIT License 5 votes vote down vote up
def __init__(self, session_key=None):
        self._cache = caches[settings.SESSION_CACHE_ALIAS]
        super().__init__(session_key) 
Example 7
Project: Hands-On-Application-Development-with-PyCharm   Author: PacktPublishing   File: cache.py    License: MIT License 5 votes vote down vote up
def __init__(self, session_key=None):
        self._cache = caches[settings.SESSION_CACHE_ALIAS]
        super().__init__(session_key) 
Example 8
Project: Hands-On-Application-Development-with-PyCharm   Author: PacktPublishing   File: cached_db.py    License: MIT License 5 votes vote down vote up
def __init__(self, session_key=None):
        self._cache = caches[settings.SESSION_CACHE_ALIAS]
        super().__init__(session_key) 
Example 9
Project: openhgsenti   Author: drexly   File: cache.py    License: Apache License 2.0 5 votes vote down vote up
def __init__(self, session_key=None):
        self._cache = caches[settings.SESSION_CACHE_ALIAS]
        super(SessionStore, self).__init__(session_key) 
Example 10
Project: openhgsenti   Author: drexly   File: cached_db.py    License: Apache License 2.0 5 votes vote down vote up
def __init__(self, session_key=None):
        self._cache = caches[settings.SESSION_CACHE_ALIAS]
        super(SessionStore, self).__init__(session_key) 
Example 11
Project: python2017   Author: bpgc-cte   File: cache.py    License: MIT License 5 votes vote down vote up
def __init__(self, session_key=None):
        self._cache = caches[settings.SESSION_CACHE_ALIAS]
        super(SessionStore, self).__init__(session_key) 
Example 12
Project: python2017   Author: bpgc-cte   File: cached_db.py    License: MIT License 5 votes vote down vote up
def __init__(self, session_key=None):
        self._cache = caches[settings.SESSION_CACHE_ALIAS]
        super(SessionStore, self).__init__(session_key)