Esempio n. 1
0
def create_app(config_name):
    global app
    app.config.from_object(config[config_name])

    # Setup database
    # Currently inits mongoDB
    init_db(app)

    # Todo make intializing blueprints consistent
    app.register_blueprint(bp_index)
    app.register_blueprint(bp_auth)
    app.register_blueprint(bp_timer)
    app.register_blueprint(v1_api)
    init_api(app)

    file_handler = FileHandler("flask.log")
    file_handler.setLevel(logging.INFO)
    app.logger.addHandler(file_handler)

    config[config_name].init_app(app)
    #
    init_flask_security(app)

    mail = Mail(app)

    return app
Esempio n. 2
0
def create_app(config_name):
    global app
    app.config.from_object(config[config_name])

    # Setup database
    # Currently inits mongoDB
    init_db(app)

    # Todo make intializing blueprints consistent
    app.register_blueprint(bp_index)
    app.register_blueprint(bp_auth)
    app.register_blueprint(bp_timer)
    init_api(app)

    config[config_name].init_app(app)
    #
    init_flask_security(app)

    mail = Mail(app)

    return app
Esempio n. 3
0
def create_app(config_name):
    global app
    app.config.from_object(config[config_name])

    # Setup database
    # Currently inits mongoDB
    init_db(app)

    # Todo make intializing blueprints consistent
    app.register_blueprint(bp_index)
    app.register_blueprint(bp_auth)
    app.register_blueprint(bp_timer)
    app.register_blueprint(v1_api)
    init_api(app)

    config[config_name].init_app(app)
    #
    init_flask_security(app)

    mail = Mail(app)

    return app