aboutsummaryrefslogtreecommitdiff
path: root/app/config.py
diff options
context:
space:
mode:
authorCara Salter <cara@devcara.com>2022-08-24 13:15:31 -0400
committerCara Salter <cara@devcara.com>2022-08-24 13:15:31 -0400
commit9de84e3fbae0f2893e9c4f1425afa06899959bf7 (patch)
treef96d33d881954edc9b03df0bc821fb35eb59c577 /app/config.py
parent4b616447715b8129ae322341959e1c2bfabbd10e (diff)
downloadnccd-9de84e3fbae0f2893e9c4f1425afa06899959bf7.tar.gz
nccd-9de84e3fbae0f2893e9c4f1425afa06899959bf7.zip
flaskify
Diffstat (limited to 'app/config.py')
-rw-r--r--app/config.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/app/config.py b/app/config.py
new file mode 100644
index 0000000..29eb2ef
--- /dev/null
+++ b/app/config.py
@@ -0,0 +1,16 @@
+import toml
+
+def load_config(path):
+ contents = toml.load(path)
+
+ result = {
+ 'SQLALCHEMY_DATABASE_URI': contents['database']['postgres_url'],
+ 'SECRET_KEY': contents['server']['secret_key'],
+ 'MAIL_SERVER': contents['email']['smtp_server'],
+ 'MAIL_PORT': contents['email']['smtp_port'],
+ 'MAIL_USE_TLS': contents['email']['smtp_tls'],
+ 'SECURITY_REGISTERABLE': True,
+ 'SECURITY_PASSWORD_SALT': contents['server']['secret_key']
+ }
+
+ return result