Merge branch 'master' into aureplop/fix_cache

This commit is contained in:
Aurélien Delobelle 2017-04-26 11:22:29 +02:00
commit 673dc0295d
4 changed files with 78 additions and 40 deletions

View file

@ -42,7 +42,8 @@ REDIS_BASE_URL = "redis://" + REDIS_AUTH + REDIS_HOST + ":" + REDIS_PORT
# Other secrets
try:
from .secret import (
SECRET_KEY, RECAPTCHA_PUBLIC_KEY, RECAPTCHA_PRIVATE_KEY, ADMINS
SECRET_KEY, RECAPTCHA_PUBLIC_KEY, RECAPTCHA_PRIVATE_KEY, ADMINS,
REDIS_PASSWD, REDIS_DB, REDIS_HOST, REDIS_PORT
)
except ImportError:
raise RuntimeError("Secrets missing")
@ -187,13 +188,15 @@ CACHES = {
# Channels settings (use db #0 of redis)
CHANNEL_REDIS_URL = REDIS_BASE_URL + "/0"
CHANNEL_LAYERS = {
"default": {
"BACKEND": "asgi_redis.RedisChannelLayer",
"CONFIG": {
"hosts": [CHANNEL_REDIS_URL],
"hosts": [(
"redis://:{passwd}@{host}:{port}/{db}"
.format(passwd=REDIS_PASSWD, host=REDIS_HOST,
port=REDIS_PORT, db=REDIS_DB)
)],
},
"ROUTING": "cof.routing.channel_routing",
}