Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ Redis Sentinel

SESSION_REDIS_SENTINEL_LIST = [(host, port), (host, port), (host, port)]
SESSION_REDIS_SENTINEL_MASTER_ALIAS = 'sentinel-master'
SESSION_REDIS = {
"password": "NMHmmgwauALmOk5TIt5kqYiLnugcMn7V",
"db": 0,
'prefix': 'session'
}

Redis Pool (Horizontal partitioning)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
4 changes: 2 additions & 2 deletions redis_sessions/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ def get(self):
settings.SESSION_REDIS_SENTINEL_LIST,
socket_timeout=settings.SESSION_REDIS_SOCKET_TIMEOUT,
retry_on_timeout=settings.SESSION_REDIS_RETRY_ON_TIMEOUT,
db=getattr(settings, 'SESSION_REDIS_DB', 0),
password=getattr(settings, 'SESSION_REDIS_PASSWORD', None)
db=settings.SESSION_REDIS.get('db', 0),
password=settings.SESSION_REDIS.get('password', None)
).master_for(settings.SESSION_REDIS_SENTINEL_MASTER_ALIAS)

elif self.connection_type == 'redis_url':
Expand Down