本文整理匯總了Python中django.conf.settings.SESSION_CACHE_ALIAS屬性的典型用法代碼示例。如果您正苦於以下問題:Python settings.SESSION_CACHE_ALIAS屬性的具體用法?Python settings.SESSION_CACHE_ALIAS怎麽用?Python settings.SESSION_CACHE_ALIAS使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類django.conf.settings
的用法示例。
在下文中一共展示了settings.SESSION_CACHE_ALIAS屬性的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: delete
# 需要導入模塊: from django.conf import settings [as 別名]
# 或者: from django.conf.settings import SESSION_CACHE_ALIAS [as 別名]
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()
示例2: __init__
# 需要導入模塊: from django.conf import settings [as 別名]
# 或者: from django.conf.settings import SESSION_CACHE_ALIAS [as 別名]
def __init__(self, session_key=None):
self._cache = caches[settings.SESSION_CACHE_ALIAS]
super(SessionStore, self).__init__(session_key)
示例3: __init__
# 需要導入模塊: from django.conf import settings [as 別名]
# 或者: from django.conf.settings import SESSION_CACHE_ALIAS [as 別名]
def __init__(self, session_key=None):
self._cache = caches[settings.SESSION_CACHE_ALIAS]
super().__init__(session_key)