Fix: Server startup error due to configuration type not being assigned correctly.

This commit is contained in:
2024-10-29 15:41:43 +00:00
parent bc2cf3fc61
commit 79d15c97cd
2 changed files with 9 additions and 4 deletions

View File

@@ -14,6 +14,7 @@ Configuration variables
from lib import argument_validation as av
import os
from dotenv import load_dotenv, find_dotenv
from flask import current_app
load_dotenv(find_dotenv())
@@ -77,14 +78,18 @@ 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')
config_env = os.getenv('FLASK_ENV', "not found")
with open('app.log', 'a') as f:
f.write(f'config_env: {config_env}\n')
# current_app.logger.error(f'config_env: {config_env}')
if config_env == 'development':
app_config = DevelopmentConfig
elif config_env == 'production':
else: ##if config_env == 'production':
app_config = ProductionConfig
"""
else:
raise ValueError("Invalid configuration environment")
"""
# environment variables
"""