aboutsummaryrefslogtreecommitdiff
path: root/gn_auth
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2024-02-27 05:14:41 +0300
committerFrederick Muriuki Muriithi2024-02-27 05:25:40 +0300
commit2716b567ef6f48db8ce980e140a895aa3d18a293 (patch)
treee8e25a7ae049223cce360d3a46921978ba8cd709 /gn_auth
parentf516712a3313ffaa5418f18ccc966d7e40a73165 (diff)
downloadgn-auth-2716b567ef6f48db8ce980e140a895aa3d18a293.tar.gz
Remove use of instance path in configurations.
Diffstat (limited to 'gn_auth')
-rw-r--r--gn_auth/__init__.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/gn_auth/__init__.py b/gn_auth/__init__.py
index 79f52fd..1ff2ad2 100644
--- a/gn_auth/__init__.py
+++ b/gn_auth/__init__.py
@@ -54,10 +54,7 @@ def setup_logging_handlers(app: Flask) -> None:
def create_app(config: Optional[dict] = None) -> Flask:
"""Create and return a new flask application."""
- app_instance_path = os.environ.get("GN_AUTH_INSTANCE_PATH")
- app = Flask(__name__,
- instance_path=app_instance_path,
- instance_relative_config=True)
+ app = Flask(__name__)
# ====== Setup configuration ======
app.config.from_object(settings) # Default settings
@@ -68,8 +65,9 @@ def create_app(config: Optional[dict] = None) -> Flask:
app.config.from_envvar("GN_AUTH_CONF")
override_settings_with_envvars(app)
- if bool(app_instance_path):## load secrets
- app.config.from_pyfile("secrets.py")
+
+ if "GN_AUTH_SECRETS" in os.environ:## load secrets
+ app.config.from_envvar("GN_AUTH_SECRETS")
# ====== END: Setup configuration ======
check_mandatory_settings(app)