From 6d1824f1c5df502d9a4ac389469aeb5b82636de1 Mon Sep 17 00:00:00 2001 From: AliBsk Date: Wed, 1 Nov 2023 16:36:01 +0300 Subject: [PATCH] adding info messages --- py4web/server_adapters.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/py4web/server_adapters.py b/py4web/server_adapters.py index e377a1cf8..9add64c52 100644 --- a/py4web/server_adapters.py +++ b/py4web/server_adapters.py @@ -195,6 +195,7 @@ def get_gunicorn_vars(self, env_file="gunicorn.saenv"): result[k] = None if v == 'None' else v if result: print(f"gunicorn: read {env_file}") + result['config'] = './' + env_file return result except OSError as ex: print(f"gunicorn: cannot read {env_file}; {ex}") @@ -206,6 +207,7 @@ def get_gunicorn_vars(self, env_file="gunicorn.saenv"): if v.startswith('{') and v.endswith('}'): v = json.loads( v.replace("'", "\"") ) result[key] = None if v == 'None' else v + result['config'] = 'environ' return result def load_config(self): @@ -263,15 +265,16 @@ def load_config(self): if 'use_native_config' in gunicorn_vars: location=gunicorn_vars['use_native_config' ] super().load_config_from_module_name_or_filename(location) + self.cfg.set('config', './' + location) print (f'gunicorn: used config {location}') return if gunicorn_vars: config.update(gunicorn_vars) - print("gunicorn: used config gunicorn.saenv", config) + location = gunicorn_vars['config'] + print(f"gunicorn: used config {location}", config) for k, v in config.items(): - #self.cfg.set(k, v) if k not in self.cfg.settings: continue try: