aboutsummaryrefslogtreecommitdiff
path: root/app/config.py
blob: 29eb2efcc8f3e657939d2adb8136039d5d7eea46 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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