summaryrefslogtreecommitdiffstats
path: root/ogcp/__init__.py
diff options
context:
space:
mode:
authorJavier Sánchez Parra <jsanchez@soleta.eu>2022-09-02 13:44:32 +0200
committerJavier Sánchez Parra <jsanchez@soleta.eu>2022-09-02 15:05:30 +0200
commit7039b2942611f605f610888e6c7970135f4b67e4 (patch)
tree6485419876674dd7548972ed81cff1a54e22bf21 /ogcp/__init__.py
parenta9bbb10e8402d99b009f1ea95b38a7b228b2d83b (diff)
Store configuration file path on a global variable
Otherwise, users may change the file path on one place of the code and forget to change the other places.
Diffstat (limited to 'ogcp/__init__.py')
-rw-r--r--ogcp/__init__.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/ogcp/__init__.py b/ogcp/__init__.py
index 5d5f3e4..58de9a4 100644
--- a/ogcp/__init__.py
+++ b/ogcp/__init__.py
@@ -11,8 +11,10 @@ from flask_babel import Babel
from flask import Flask
from os import urandom
+ogcp_cfg_path = 'cfg/ogcp.json'
+
app = Flask(__name__)
-app.config.from_json('cfg/ogcp.json')
+app.config.from_json(ogcp_cfg_path)
app.secret_key = urandom(16)
babel = Babel(app)