Skip to content

Commit df6786f

Browse files
Adding new Redis config (#414)
* Adding new Redis config * flake8
1 parent edd5f91 commit df6786f

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

djangosnippets/settings/production.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,16 +71,17 @@ def env_to_bool(input):
7171
parse.uses_netloc.append("redis")
7272

7373
# Now do redis and the cache.
74-
redis_url = parse.urlparse(os.environ["REDISTOGO_URL"])
74+
redis_url = parse.urlparse(os.environ.get("REDISCLOUD_URL"))
7575
CACHES = {
7676
"default": {
7777
"BACKEND": "redis_cache.RedisCache",
7878
"LOCATION": "%s:%s" % (redis_url.hostname, redis_url.port),
79-
"OPTIONS": {"DB": 0, "PASSWORD": redis_url.password, "PARSER_CLASS": "redis.connection.HiredisParser"},
80-
"VERSION": os.environ.get("CACHE_VERSION", 0),
81-
},
79+
"OPTIONS": {
80+
"PASSWORD": redis_url.password,
81+
"DB": 0,
82+
},
83+
}
8284
}
83-
8485
# Use Sentry for debugging if available.
8586
if "SENTRY_DSN" in os.environ:
8687
sentry_sdk.init(dsn=os.environ.get("SENTRY_DSN"), integrations=[DjangoIntegration()], send_default_pii=True)

0 commit comments

Comments
 (0)