From f6e0eb7a024f4d2ac7bb81ee275822dc8cd5f47b Mon Sep 17 00:00:00 2001 From: teddy Date: Tue, 29 Oct 2024 15:46:46 +0000 Subject: [PATCH] Fix: Server startup error due to configuration type not being assigned correctly. --- config.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/config.py b/config.py index c1c825ec..ba6b917f 100644 --- a/config.py +++ b/config.py @@ -78,18 +78,16 @@ class ProductionConfig(Config): # Set the configuration class based on the environment # You can change 'development' to 'production' when deploying -config_env = os.getenv('FLASK_ENV', "not found") +config_env = os.getenv('FLASK_ENV', "production") with open('app.log', 'a') as f: f.write(f'config_env: {config_env}\n') - # current_app.logger.error(f'config_env: {config_env}') + # current_app.logger.error(f'config_env: {config_env}') # logger not yet initialised if config_env == 'development': app_config = DevelopmentConfig -else: ##if config_env == 'production': +elif config_env == 'production': app_config = ProductionConfig -""" else: raise ValueError("Invalid configuration environment") -""" # environment variables """