diff --git a/server/config.py b/server/config.py index 996e538a..d1c0ab09 100644 --- a/server/config.py +++ b/server/config.py @@ -8,8 +8,8 @@ class Config(object): """ Config object for flask app """ - - load_dotenv(".env") + environment = os.environ.get("environment", "") + load_dotenv(f".env{environment}") SQLALCHEMY_DATABASE_URI = os.environ.get("DATABASE_URI") # 'sqlite:///' + os.path.join(basedir, 'app.db') SQLALCHEMY_TRACK_MODIFICATIONS = False diff --git a/server/extensions.py b/server/extensions.py index 1ef41774..138431aa 100644 --- a/server/extensions.py +++ b/server/extensions.py @@ -21,7 +21,8 @@ Declares extension for Flask App, connects with already existing database """ # specifying engine according to existing db -load_dotenv(".env") +environment = os.environ.get("environment", "") +load_dotenv(f".env{environment}") if not strtobool(os.environ.get("TESTING", "True")):