diff options
Diffstat (limited to 'app/config.py')
-rw-r--r-- | app/config.py | 16 |
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 |