fix(config): now loading config from env correctly

This commit is contained in:
2021-11-29 15:26:28 +01:00
parent a1d5bce066
commit 7c3fac227f
2 changed files with 35 additions and 8 deletions

View File

@@ -1,14 +1,10 @@
from flask import Flask
from . import reset
from . import reset, config
def create_app():
app = Flask(__name__, instance_relative_config=True, template_folder="ui/templates", static_folder="ui/static")
#app.config.from_object("instance.config.DebugConfig")
app.config.from_envvar("LDAP_ADDR")
app.config.from_envvar("LDAP_PORT")
app.config.from_envvar("LDAP_TLS")
app.config.from_envvar("BASE_DN")
app = Flask(__name__, template_folder="ui/templates", static_folder="ui/static")
app.config.from_object(config.ProductionConfig())
app.register_blueprint(reset.bp)
return app
return app