Integrate the possibility to create a minimal app for auxillary functions.

This commit is contained in:
Patrick Jentsch 2019-08-28 17:19:08 +02:00
parent e5ea98510e
commit b48e74f560

View File

@ -15,12 +15,16 @@ mail = Mail()
socketio = SocketIO() socketio = SocketIO()
def create_app(config_name): def create_app(config_name, main=True):
app = Flask(__name__) app = Flask(__name__)
app.config.from_object(config[config_name]) app.config.from_object(config[config_name])
config[config_name].init_app(app) config[config_name].init_app(app)
db.init_app(app) db.init_app(app)
if not main:
return app
login_manager.init_app(app) login_manager.init_app(app)
mail.init_app(app) mail.init_app(app)
# scheduler.init_app(app) # scheduler.init_app(app)