diff options
| author | Frederick Muriuki Muriithi | 2025-10-15 17:44:22 -0500 |
|---|---|---|
| committer | Frederick Muriuki Muriithi | 2025-10-15 17:44:22 -0500 |
| commit | 977efbb54da284fb3e8476f200206d00cb8e64cd (patch) | |
| tree | dbe02a37da26b256ba054799cbd1d19eb0683777 /gn3/app.py | |
| parent | d24ffc9afa92c7d938813ee6745f8d43ac88a0a8 (diff) | |
| download | genenetwork3-977efbb54da284fb3e8476f200206d00cb8e64cd.tar.gz | |
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
Diffstat (limited to 'gn3/app.py')
| -rw-r--r-- | gn3/app.py | 6 |
1 files changed, 4 insertions, 2 deletions
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: |
