Example #1
0
def create_app(config="widukind_web.settings.Prod", db=None):

    env_config = config_from_env("WIDUKIND_SETTINGS", config)

    app = Flask(__name__)
    app.config.from_object(env_config)

    _conf_db(app, db=db)

    app.config["LOGGER_NAME"] = "widukind_web"
    app._logger = _conf_logging(debug=app.debug, prog_name="widukind_web")

    if app.config.get("LOGGING_MONGO_ENABLE", True):
        _conf_logging_mongo(app)

    if app.config.get("LOGGING_MAIL_ENABLE", False):
        _conf_logging_mail(app)

    _conf_logging_errors(app)

    extensions.moment.init_app(app)

    _conf_bootstrap(app)

    _conf_sentry(app)

    _conf_errors(app)

    _conf_cache(app)

    _conf_converters(app)

    _conf_jsonify(app)

    _conf_default_views(app)

    _conf_bp(app)

    _conf_record_query(app)

    _conf_processors(app)

    _conf_periods(app)

    _conf_auth(app)

    _conf_sitemap(app)

    _conf_session(app)

    _conf_mail(app)

    _conf_assets(app)

    app.wsgi_app = ProxyFix(app.wsgi_app)

    return app
Example #2
0
def create_app(config="widukind_web.settings.Prod"):

    env_config = config_from_env("WIDUKIND_SETTINGS", config)

    app = Flask(__name__)
    app.config.from_object(env_config)

    _conf_db(app)

    app.config["LOGGER_NAME"] = "widukind_web"
    app._logger = _conf_logging(debug=app.debug, prog_name="widukind_web")

    if app.config.get("LOGGING_MONGO_ENABLE", True):
        _conf_logging_mongo(app)

    if app.config.get("LOGGING_MAIL_ENABLE", False):
        _conf_logging_mail(app)

    _conf_logging_errors(app)

    extensions.moment.init_app(app)

    _conf_bootstrap(app)

    # _conf_themes(app)

    _conf_sentry(app)

    # if app.config.get('SESSION_ENGINE_ENABLE', False):
    #    from flask_mongoengine import MongoEngineSessionInterface
    #    app.session_interface = MongoEngineSessionInterface(extensions.db)

    _conf_errors(app)

    _conf_cache(app)

    _conf_converters(app)

    _conf_jsonify(app)

    _conf_default_views(app)

    _conf_bp(app)

    _conf_record_query(app)

    _conf_processors(app)

    _conf_auth(app)

    _conf_sitemap(app)

    _conf_session(app)

    _conf_mail(app)

    _conf_locker(app)

    _conf_counters(app)

    app.wsgi_app = ProxyFix(app.wsgi_app)

    return app