birb-scheduler-teller/birb_scheduler_teller/config.py

25 lines
630 B
Python
Raw Normal View History

2021-12-10 21:59:56 +01:00
import os
2021-12-10 23:04:41 +01:00
def parse_default_while_not_defined():
envvar = os.environ.get("DEFAULT_WHILE_NOT_DEFINED")
if not envvar:
return None, None
2021-12-10 23:46:23 +01:00
return envvar.split(';', 1)[:2]
2021-12-10 23:04:41 +01:00
2021-12-10 21:59:56 +01:00
class Config:
SECRET_KEY = os.environ.get('SECRET_KEY', os.urandom(12))
SENTRY_DSN = os.environ.get("SENTRY_DSN")
RELEASE_ID = os.environ.get("RELEASE_ID", "test")
RELEASEMODE = os.environ.get("RELEASEMODE", "dev")
2021-12-10 23:04:41 +01:00
REDIS_URL = os.environ.get("REDIS_URL", "redis://localhost:6379/0")
2021-12-10 21:59:56 +01:00
2021-12-10 23:04:41 +01:00
DEFAULT_WHILE_NOT_DEFINED = parse_default_while_not_defined()
2021-12-10 21:59:56 +01:00
2021-12-10 23:04:41 +01:00
DEVICE_TIMEOUT = int(os.environ.get("DEVICE_TIMEOUT", 120))