Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Redis To Go

  • Loading branch information...
commit 659bb694cab2d8cd15934730d14f10321a59ed7b 1 parent 3ec10a5
@awsum awsum authored
Showing with 10 additions and 1 deletion.
  1. +10 −1 flask_heroku.py
View
11 flask_heroku.py
@@ -1,5 +1,6 @@
#!/usr/bin/env python
+import urlparse
from os import environ
class Heroku(object):
@@ -26,4 +27,12 @@ def __init__(self, app):
# Mailgun
self.app.config.setdefault('SMTP_SERVER', environ.get('MAILGUN_SMTP_SERVER'))
self.app.config.setdefault('SMTP_LOGIN', environ.get('MAILGUN_SMTP_LOGIN'))
- self.app.config.setdefault('SMTP_PASSWORD', environ.get('MAILGUN_SMTP_PASSWORD'))
+ self.app.config.setdefault('SMTP_PASSWORD', environ.get('MAILGUN_SMTP_PASSWORD'))
+
+ # Redis To Go
+ redis_url = environ.get('REDISTOGO_URL')
+ if redis_url:
+ url = urlparse.urlparse(redis_url)
+ self.app.config.setdefault('REDIS_HOST', url.hostname)
+ self.app.config.setdefault('REDIS_PORT', url.port)
+ self.app.config.setdefault('REDIS_PASSWORD', url.password)
Please sign in to comment.
Something went wrong with that request. Please try again.