Fix: Server startup error due to configuration type not being assigned correctly.
This commit is contained in:
@@ -78,18 +78,16 @@ class ProductionConfig(Config):
|
|||||||
|
|
||||||
# Set the configuration class based on the environment
|
# Set the configuration class based on the environment
|
||||||
# You can change 'development' to 'production' when deploying
|
# 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:
|
with open('app.log', 'a') as f:
|
||||||
f.write(f'config_env: {config_env}\n')
|
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':
|
if config_env == 'development':
|
||||||
app_config = DevelopmentConfig
|
app_config = DevelopmentConfig
|
||||||
else: ##if config_env == 'production':
|
elif config_env == 'production':
|
||||||
app_config = ProductionConfig
|
app_config = ProductionConfig
|
||||||
"""
|
|
||||||
else:
|
else:
|
||||||
raise ValueError("Invalid configuration environment")
|
raise ValueError("Invalid configuration environment")
|
||||||
"""
|
|
||||||
|
|
||||||
# environment variables
|
# environment variables
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user