From 9de84e3fbae0f2893e9c4f1425afa06899959bf7 Mon Sep 17 00:00:00 2001 From: Cara Salter Date: Wed, 24 Aug 2022 13:15:31 -0400 Subject: flaskify --- app/config.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 app/config.py (limited to 'app/config.py') 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 -- cgit v1.2.3