Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Respect REDIS_URL variable from cloud providers

Artur Smęte56aa80f5c3e
diff --git a/docs/gettingstarted/configuration.rst b/docs/gettingstarted/configuration.rst
index 875438b7d0..150adc1795 100644
--- a/docs/gettingstarted/configuration.rst
+++ b/docs/gettingstarted/configuration.rst
@@ -12,7 +12,7 @@ Environment variables
Separate multiple values with comma.
-``CACHE_URL``
+``CACHE_URL`` or ``REDIS_URL``
The URL of a cache database. Defaults to local process memory.
Redis is recommended. Heroku's Redis will export this setting automatically.
diff --git a/saleor/settings.py b/saleor/settings.py
index c096ac4ecf..f9a55e9542 100644
--- a/saleor/settings.py
+++ b/saleor/settings.py
@@ -28,6 +28,10 @@ MANAGERS = ADMINS
INTERNAL_IPS = get_list(os.environ.get('INTERNAL_IPS', '127.0.0.1'))
+# Some cloud providers like Heroku export REDIS_URL variable instead of CACHE_URL
+REDIS_URL = os.environ.get('REDIS_URL')
+if REDIS_URL:
+ CACHE_URL = os.environ.setdefault('CACHE_URL', REDIS_URL)
CACHES = {'default': django_cache_url.config()}
DATABASES = {