From 977efbb54da284fb3e8476f200206d00cb8e64cd Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Wed, 15 Oct 2025 17:44:22 -0500 Subject: Configurations: Use non-executable file for settings. Move configuration from executable .py file into a non-executable .json file. See https://issues.genenetwork.org/issues/genenetwork3/genenetwork3_configuration --- gn3/app.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'gn3/app.py') diff --git a/gn3/app.py b/gn3/app.py index 864ae99..0868f3a 100644 --- a/gn3/app.py +++ b/gn3/app.py @@ -1,7 +1,7 @@ """Entry point from spinning up flask""" - import os import sys +import json import logging from pathlib import Path @@ -63,7 +63,9 @@ def create_app(config: Union[Dict, str, None] = None) -> Flask: """Create a new flask object""" app = Flask(__name__) # Load default configuration - app.config.from_object("gn3.settings") + app.config.from_file( + Path(__file__).absolute().parent.joinpath("settings.json"), + load=json.load) # Load environment configuration if "GN3_CONF" in os.environ: -- cgit 1.4.1