Skip to content

Commit

Permalink
Try using redis tls config as recommended
Browse files Browse the repository at this point in the history
  • Loading branch information
justuswilhelm committed Sep 8, 2023
1 parent 5c1c617 commit 468fa7b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 94 deletions.
49 changes: 0 additions & 49 deletions projectify/redis_helper.py

This file was deleted.

25 changes: 8 additions & 17 deletions projectify/settings/production.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
"""Production settings."""
import os
import ssl

from .. import (
redis_helper,
)

# flake8: noqa: F401, F403
from .base import *
Expand Down Expand Up @@ -75,22 +70,18 @@
STRIPE_PRICE_OBJECT = os.environ["STRIPE_PRICE_OBJECT"]
STRIPE_ENDPOINT_SECRET = os.environ["STRIPE_ENDPOINT_SECRET"]

# REDIS
# https://devcenter.heroku.com/articles/connecting-heroku-redis#connecting-in-python
# Obviously, this isn't great
# https://github.com/django/channels_redis/issues/235
# https://github.com/django/channels_redis/pull/337
redis_url = redis_helper.decode_redis_url(
os.environ["REDIS_TLS_URL"],
)

# Django Channels configuration
# channels_redis
# From:
# https://github.com/django/channels_redis/blob/1e9b7387814f3c1dae5cab5034624e283f88b4bf/README.rst?plain=1#L76
CHANNEL_LAYERS = {
"default": {
"BACKEND": "channels_redis.core.RedisChannelLayer",
"CONFIG": {
"hosts": [
redis_helper.make_channels_redis_host(redis_url),
],
"hosts": {
"address": REDIS_TLS_URL,
"ssl_cert_reqs": None,
},
"symmetric_encryption_keys": [SECRET_KEY],
},
},
Expand Down
28 changes: 0 additions & 28 deletions projectify/settings/test_redis.py

This file was deleted.

0 comments on commit 468fa7b

Please sign in to comment.