From 0e51f193c273fc90ed5cfc294cdd5a479469c6a2 Mon Sep 17 00:00:00 2001 From: Alex Wright Date: Sat, 17 Nov 2018 09:45:33 +0100 Subject: [PATCH] Adding configparser to get config form a .ini --- backend/src/app.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/backend/src/app.py b/backend/src/app.py index 874c772..0c7aafa 100644 --- a/backend/src/app.py +++ b/backend/src/app.py @@ -1,7 +1,15 @@ import logging +import configparser from flask import Flask, render_template from forms import UserLookupForm +config = configparser.ConfigParser() +config.read('config.ini') + +LDAP_SERVER = config.get('LDAP', 'host') +LDAP_BIND_DN = config.get('LDAP', 'bind_dn') +LDAP_PASSWORD = config.get('LDAP', 'bind_password') + app = Flask(__name__) app.logger.setLevel(logging.INFO)