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('/') 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