Skip to content
This repository was archived by the owner on Aug 26, 2021. It is now read-only.

Commit 1962cbb

Browse files
Merge pull request #31 from mattstibbs/patch-1
Add support for Heroku Redis
2 parents 6b1525c + ff31f3c commit 1962cbb

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

flask_heroku.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,14 @@ def init_app(self, app):
6767
app.config.setdefault('MAIL_PASSWORD', environ.get('POSTMARK_API_KEY'))
6868
app.config.setdefault('MAIL_USE_TLS', True)
6969

70+
# Heroku Redis
71+
redis_url = environ.get('REDIS_URL')
72+
if redis_url:
73+
url = urlparse(redis_url)
74+
app.config.setdefault('REDIS_HOST', url.hostname)
75+
app.config.setdefault('REDIS_PORT', url.port)
76+
app.config.setdefault('REDIS_PASSWORD', url.password)
77+
7078
# Redis To Go
7179
redis_url = environ.get('REDISTOGO_URL')
7280
if redis_url:

0 commit comments

Comments
 (0)