From c74b57aba240ee1d6f10c17d6c16ead41343f84f Mon Sep 17 00:00:00 2001 From: yuanzhou Date: Mon, 11 Aug 2025 10:50:46 -0400 Subject: [PATCH 1/2] Move app instantiation to above logger --- src/app.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app.py b/src/app.py index e358111c..4542490e 100644 --- a/src/app.py +++ b/src/app.py @@ -47,6 +47,10 @@ from hubmap_commons.exceptions import HTTPException from hubmap_commons.S3_worker import S3Worker +# Specify the absolute path of the instance folder and use the config file relative to the instance path +app = Flask(__name__, instance_path = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'instance'), instance_relative_config = True) +app.config.from_pyfile('app.cfg') + # Root logger configuration global logger @@ -60,10 +64,6 @@ # will be inherited by the sub-module loggers logger = logging.getLogger() -# Specify the absolute path of the instance folder and use the config file relative to the instance path -app = Flask(__name__, instance_path = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'instance'), instance_relative_config = True) -app.config.from_pyfile('app.cfg') - # Remove trailing slash / from URL base to avoid "//" caused by config with trailing slash app.config['UUID_API_URL'] = app.config['UUID_API_URL'].strip('/') app.config['INGEST_API_URL'] = app.config['INGEST_API_URL'].strip('/') From 6035918922887dc56077e703b768ac778098d9fc Mon Sep 17 00:00:00 2001 From: yuanzhou Date: Mon, 11 Aug 2025 10:51:35 -0400 Subject: [PATCH 2/2] Update app.cfg.example --- src/instance/app.cfg.example | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/instance/app.cfg.example b/src/instance/app.cfg.example index 9cab5ad9..37b4f792 100644 --- a/src/instance/app.cfg.example +++ b/src/instance/app.cfg.example @@ -1,5 +1,4 @@ -# Set to False for PROD deployment to use INFO logging level -# Default to DEBUG for DEV/TEST +# Set to False to use INFO logging level DEBUG_MODE = True # Set to True to disable the PUT and POST calls to make entity-api READ-ONLY