Adding configparser to get config form a .ini

This commit is contained in:
Alex Wright 2018-11-17 09:45:33 +01:00
parent 5c9415cf6f
commit 0e51f193c2
1 changed files with 8 additions and 0 deletions

View File

@ -1,7 +1,15 @@
import logging import logging
import configparser
from flask import Flask, render_template from flask import Flask, render_template
from forms import UserLookupForm 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 = Flask(__name__)
app.logger.setLevel(logging.INFO) app.logger.setLevel(logging.INFO)