Fix #640: support connecting with to a password protected redis server

This commit is contained in:
Eliot Berriot 2018-12-20 17:36:32 +01:00
parent ab7c9d511c
commit d27ea30b26
No known key found for this signature in database
GPG key ID: DD6965E2476E5C27
4 changed files with 9 additions and 5 deletions

View file

@ -13,7 +13,7 @@ from __future__ import absolute_import, unicode_literals
import datetime
import logging
from urllib.parse import urlparse, urlsplit
from urllib.parse import urlsplit
import environ
from celery.schedules import crontab
@ -420,11 +420,10 @@ CACHES = {
CACHES["default"]["BACKEND"] = "django_redis.cache.RedisCache"
cache_url = urlparse(CACHES["default"]["LOCATION"])
CHANNEL_LAYERS = {
"default": {
"BACKEND": "channels_redis.core.RedisChannelLayer",
"CONFIG": {"hosts": [(cache_url.hostname, cache_url.port)]},
"CONFIG": {"hosts": [CACHES["default"]["LOCATION"]]},
}
}