linted plenario/settings.py
from os import environ
+
get = environ.get
+
SECRET_KEY = get('SECRET_KEY', 'abcdefghijklmnop')
+
PLENARIO_SENTRY_URL = get('PLENARIO_SENTRY_URL', None)
+
DATA_DIR = '/tmp'
# Travis CI relies on the default values to build correctly,
@@ -22,13 +26,11 @@ RS_HOST = get('REDSHIFT_HOST', 'localhost')
RS_PORT = get('REDSHIFT_PORT', 5432)
RS_NAME = get('REDSHIFT_NAME', 'plenario_test')
-DATABASE_CONN = 'postgresql://{}:{}@{}:{}/{}'.\
- format(DB_USER, DB_PASSWORD, DB_HOST, DB_PORT, DB_NAME)
-REDSHIFT_CONN = 'postgresql://{}:{}@{}:{}/{}'.\
- format(RS_USER, RS_PASSWORD, RS_HOST, RS_PORT, RS_NAME)
+DATABASE_CONN = 'postgresql://{}:{}@{}:{}/{}'.format(DB_USER, DB_PASSWORD, DB_HOST, DB_PORT, DB_NAME)
+REDSHIFT_CONN = 'postgresql://{}:{}@{}:{}/{}'.format(RS_USER, RS_PASSWORD, RS_HOST, RS_PORT, RS_NAME)
# Use this cache for data that can be refreshed
-REDIS_HOST = get('REDIS_HOST', "localhost")
+REDIS_HOST = get('REDIS_HOST', 'localhost')
# See: https://pythonhosted.org/Flask-Cache/#configuring-flask-cache
# for config options
@@ -53,7 +55,11 @@ S3_BUCKET = get('S3_BUCKET', '')
# Email address for notifying site administrators
# Expect comma-delimited list of emails.
-ADMIN_EMAILS = get('ADMIN_EMAILS').split(',') if get('ADMIN_EMAILS') else []
+_admin_emails = get('ADMIN_EMAILS')
+if _admin_emails:
+ ADMIN_EMAILS = _admin_emails.split(',')
+else:
+ ADMIN_EMAILS = []
# For emailing users. ('MAIL_USERNAME' is an email address.)
MAIL_SERVER = get('MAIL_SERVER', 'smtp.gmail.com')
@@ -63,10 +69,10 @@ MAIL_DISPLAY_NAME = 'Plenar.io Team'
MAIL_USERNAME = get('MAIL_USERNAME', '')
MAIL_PASSWORD = get('MAIL_PASSWORD', '')
-# Toggle maintenence mode
+# Toggle maintenance mode
MAINTENANCE = False
# Celery
-CELERY_BROKER_URL = get("CELERY_BROKER_URL") or "redis://%s:6379/0" % REDIS_HOST
-CELERY_RESULT_BACKEND = get("CELERY_RESULT_BACKEND") or "db+" + DATABASE_CONN
-FLOWER_URL = get("FLOWER_URL") or "http://localhost:5555"
+CELERY_BROKER_URL = get('CELERY_BROKER_URL', 'redis://{}:6379/0'.format(REDIS_HOST))
+CELERY_RESULT_BACKEND = get('CELERY_RESULT_BACKEND', 'db+{}'.format(DATABASE_CONN))
+FLOWER_URL = get('FLOWER_URL', 'http://localhost:5555')
