Skip to content

Commit

Permalink
bug-1907816: Allow using a Redis password.
Browse files Browse the repository at this point in the history
  • Loading branch information
smarnach committed Jul 16, 2024
1 parent dea87e1 commit 1d02937
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tecken/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,12 @@ def filter(self, record):
)

REDIS_URL = _config("REDIS_URL", doc="URL for Redis.")
REDIS_PASSWORD = (
_config(
"REDIS_PASSWORD", doc="Password for the Redis AUTH command.", raise_error=False
)
or None
)
REDIS_SOCKET_CONNECT_TIMEOUT = 2
REDIS_SOCKET_TIMEOUT = 2

Expand All @@ -417,6 +423,7 @@ def filter(self, record):
"BACKEND": "django_redis.cache.RedisCache",
"LOCATION": REDIS_URL,
"OPTIONS": {
"PASSWORD": REDIS_PASSWORD,
"COMPRESSOR": "django_redis.compressors.zlib.ZlibCompressor",
"SERIALIZER": "django_redis.serializers.msgpack.MSGPackSerializer",
"SOCKET_CONNECT_TIMEOUT": REDIS_SOCKET_CONNECT_TIMEOUT,
Expand Down

0 comments on commit 1d02937

Please sign in to comment.