import toml def load_config(path): contents = toml.load(path) result = { 'SQLALCHEMY_DATABASE_URI': contents['database']['postgres_url'], 'SECRET_KEY': contents['server']['secret_key'], 'DEBUG': contents['server']['debug'], 'SECURITY_REGISTERABLE': True, 'SECURITY_PASSWORD_SALT': contents['server']['secret_key'] } return result