root: fix channels not loading redis connection details

This commit is contained in:
Jens Langhammer 2020-09-14 14:21:43 +02:00
parent b11d6a5891
commit 7ea5c22b6c
2 changed files with 7 additions and 1 deletions

View File

@ -10,6 +10,7 @@ redis:
password: '' password: ''
cache_db: 0 cache_db: 0
message_queue_db: 1 message_queue_db: 1
ws_db: 2
debug: false debug: false
log_level: info log_level: info

View File

@ -193,7 +193,12 @@ ASGI_APPLICATION = "passbook.root.routing.application"
CHANNEL_LAYERS = { CHANNEL_LAYERS = {
"default": { "default": {
"BACKEND": "channels_redis.core.RedisChannelLayer", "BACKEND": "channels_redis.core.RedisChannelLayer",
"CONFIG": {"hosts": [(CONFIG.y("redis.host"), 6379)]}, "CONFIG": {
"hosts": [
f"redis://:{CONFIG.y('redis.password')}@{CONFIG.y('redis.host')}:6379"
f"/{CONFIG.y('redis.ws_db')}"
],
},
}, },
} }