Просмотр исходного кода

Fixes Cacheops with a password protected redis

As per the [`README.rst`][1] of `django-cacheops`, if a password is
added to the connection string, it must be in the form
`redis://:password@host:port/db`. Notice the colon, which was missing
from the implementation in [`settings.py`][2].

[1]: https://github.com/Suor/django-cacheops/blob/8ad970d55a3782fbaa027332dcc4ae1ee8c41437/README.rst
[2]: https://github.com/digitalocean/netbox/blob/86d5b48007a514e0c7968c9711fed5ede0a78f6c/netbox/netbox/settings.py#L349
Christian Mäder 6 лет назад
Родитель
Сommit
94ca3abefc
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      netbox/netbox/settings.py

+ 1 - 1
netbox/netbox/settings.py

@@ -346,7 +346,7 @@ else:
     REDIS_CACHE_CON_STRING = 'redis://'
 
 if REDIS_PASSWORD:
-    REDIS_CACHE_CON_STRING = '{}{}@'.format(REDIS_CACHE_CON_STRING, REDIS_PASSWORD)
+    REDIS_CACHE_CON_STRING = '{}:{}@'.format(REDIS_CACHE_CON_STRING, REDIS_PASSWORD)
 
 REDIS_CACHE_CON_STRING = '{}{}:{}/{}'.format(REDIS_CACHE_CON_STRING, REDIS_HOST, REDIS_PORT, REDIS_CACHE_DATABASE)