Initialize actions with the given :class:`flask.Flask` object.

        :param app: The flask application object
        :type app: :class:`~flask.Flask`
518275
def _init_app(self, app):
        
        for resource, urls, kwargs in self.resources:
            self._register_view(app, resource, *urls, **kwargs)
177948
def init_app(self, app):
        
        app.config.setdefault('PRETTIFY', False)

        if app.config['PRETTIFY']:
            app.after_request(self._prettify_response)
103845
def init_app(self, app):
        
        app.config.setdefault('FEDORA_BASE_URL', 'http://localhost:8080')
        if hasattr(app, 'teardown_appcontext'):
            app.teardown_appcontext(self.teardown)
        else:
            app.teardown_request(self.teardown)
370024
def init_app(self, app=None, blueprint=None, additional_blueprints=None):
        
        if app is not None:
            self.app = app

        if blueprint is not None:
            self.blueprint = blueprint

        for resource in self.resources:
            self.route(resource['resource'],
                       resource['view'],
                       *resource['urls'],
                       url_rule_options=resource['url_rule_options'])

        if self.blueprint is not None:
            self.app.register_blueprint(self.blueprint)

        if additional_blueprints is not None:
            for blueprint in additional_blueprints:
                self.app.register_blueprint(blueprint)

        self.app.config.setdefault('PAGE_SIZE', 30)
112153
def init_app(self, app):
        
        if not hasattr(app, 'extensions'):
            app.extensions = {}

        app.extensions['nav'] = self
        app.add_template_global(self.elems, 'nav')

        # register some renderers
        for args in self._renderers:
            register_renderer(app, *args)
124781
def init_app(self, app):
        

        if self.__inited:
            return

        config = app.config.get(
            'FLASK_LOGGING_EXTRAS', {})

        blueprint_config = config.get('BLUEPRINT', {})
        self.bp_var = blueprint_config.get('FORMAT_NAME', 'blueprint')
        self.bp_app = blueprint_config.get('APP_BLUEPRINT', '<app>')
        self.bp_noreq = blueprint_config.get('NO_REQUEST_BLUEPRINT', '<not a request>')

        for var_name, resolver_fqn in config.get('RESOLVERS', {}).items():
            if resolver_fqn is None:
                resolver = None
            else:
                try:
                    resolver = _import_by_string(resolver_fqn)
                except ImportError:
                    resolver = resolver_fqn

            self.resolvers[var_name] = resolver

            self.__inited = True
1283669
def init_app(self, app):
        
        app.extensions = getattr(app, 'extensions', {})
        app.extensions['docker.client'] = None

        app.config.setdefault('DOCKER_URL', None)
        app.config.setdefault('DOCKER_VERSION', '1.16')
        app.config.setdefault('DOCKER_TIMEOUT', 30)
        app.config.setdefault('DOCKER_TLS', False)
        app.config.setdefault('DOCKER_TLS_VERIFY', True)
        app.config.setdefault('DOCKER_TLS_SSL_VERSION', None)
        app.config.setdefault('DOCKER_TLS_ASSERT_HOSTNAME', None)

        app.config.setdefault('DOCKER_TLS_CERT_PATH', None)
        app.config.setdefault('DOCKER_TLS_CLIENT_CERT', None)
        app.config.setdefault('DOCKER_TLS_CA_CERT', None)
1193532
def init_app(self, app,
                 entry_point_group='invenio_workflows.workflows',
                 **kwargs):
        """"""
        app.config.setdefault(
            "WORKFLOWS_OBJECT_CLASS",
            "invenio_workflows.api.WorkflowObject"
        )
        state = _WorkflowState(
            app, entry_point_group=entry_point_group, **kwargs
        )
        app.extensions['invenio-workflows'] = state
        return state
282657
def init_app(self, app, database=None):
        """"""

        # Register application
        if not app:
            raise RuntimeError('Invalid application.')
        self.app = app
        if not hasattr(app, 'extensions'):
            app.extensions = {}
        app.extensions['peewee'] = self

        app.config.setdefault('PEEWEE_CONNECTION_PARAMS', {})
        app.config.setdefault('PEEWEE_DATABASE_URI', 'sqlite:///peewee.sqlite')
        app.config.setdefault('PEEWEE_MANUAL', False)
        app.config.setdefault('PEEWEE_MIGRATE_DIR', 'migrations')
        app.config.setdefault('PEEWEE_MIGRATE_TABLE', 'migratehistory')
        app.config.setdefault('PEEWEE_MODELS_CLASS', Model)
        app.config.setdefault('PEEWEE_MODELS_IGNORE', [])
        app.config.setdefault('PEEWEE_MODELS_MODULE', '')
        app.config.setdefault('PEEWEE_READ_SLAVES', '')
        app.config.setdefault('PEEWEE_USE_READ_SLAVES', True)

        # Initialize database
        params = app.config['PEEWEE_CONNECTION_PARAMS']
        database = database or app.config.get('PEEWEE_DATABASE_URI')
        if not database:
            raise RuntimeError('Invalid database.')
        database = get_database(database, **params)

        slaves = app.config['PEEWEE_READ_SLAVES']
        if isinstance(slaves, string_types):
            slaves = slaves.split(',')
        self.slaves = [get_database(slave, **params) for slave in slaves if slave]

        self.database.initialize(database)
        if self.database.database == ':memory:':
            app.config['PEEWEE_MANUAL'] = True

        if not app.config['PEEWEE_MANUAL']:
            app.before_request(self.connect)
            app.teardown_request(self.close)
335597
def init_app(self, app):
        
        app.scoped_session = self

        @app.teardown_appcontext
        def remove_scoped_session(*args, **kwargs):
            # pylint: disable=missing-docstring,unused-argument,unused-variable
            app.scoped_session.remove()
553719
def init_app(self, app):
        
        # Save this so we can use it later in the extension
        if not hasattr(app, 'extensions'):  # pragma: no cover
            app.extensions = {}
        app.extensions['flask-graphql-auth'] = self

        self._set_default__configuration_options(app)
1152757
def init_app(self, app,
                 entry_point_group_mappings='invenio_search.mappings',
                 entry_point_group_templates='invenio_search.templates',
                 **kwargs):
        
        self.init_config(app)

        app.cli.add_command(index_cmd)

        state = _SearchState(
            app,
            entry_point_group_mappings=entry_point_group_mappings,
            entry_point_group_templates=entry_point_group_templates,
            **kwargs
        )
        self._state = app.extensions['invenio-search'] = state
863712
def after_init_app(self, app: FlaskUnchained):
        

        from flask_wtf.csrf import generate_csrf

        # send CSRF token in the cookie
        @app.after_request
        def set_csrf_cookie(response):
            if response:
                response.set_cookie('csrf_token', generate_csrf())
            return response
720718
def init_app(self, app):
        
        app.extensions = getattr(app, "extensions", {})

        # If using Flask-SQLAlchemy, attach db.session to ModelSchema
        if has_sqla and "sqlalchemy" in app.extensions:
            db = app.extensions["sqlalchemy"].db
            self.ModelSchema.OPTIONS_CLASS.session = db.session
        app.extensions[EXTENSION_NAME] = self
281884
def init(self, app):
        
        cfg = app.config
        self.welcome_message = cfg.get('USER_SEND_WELCOME_MESSAGE')
        self.require_confirmation = cfg.get(
            'USER_ACCOUNTS_REQUIRE_CONFIRMATION'
        )

        subjects = cfg.get('USER_EMAIL_SUBJECTS')
        self.email_subjects = subjects if subjects else dict()

        self.jwt_secret = cfg.get('USER_JWT_SECRET')
        self.jwt_algo = cfg.get('USER_JWT_ALGO')
        self.jwt_lifetime = cfg.get('USER_JWT_LIFETIME_SECONDS')
        self.jwt_implementation = cfg.get('USER_JWT_IMPLEMENTATION')
        self.jwt_loader_implementation = cfg.get(
            'USER_JWT_LOADER_IMPLEMENTATION'
        )
249470
def init_app(self, app, entry_point_group='invenio_celery.tasks',
                 **kwargs):
        """"""
        self.init_config(app)
        self.celery = FlaskCeleryExt(app).celery
        self.entry_point_group = entry_point_group
        app.extensions['invenio-celery'] = self
39243
def init_app(self, app):
        
        self.__init__(aws_access_key_id=app.config.get("SES_AWS_ACCESS_KEY"),
                      aws_secret_access_key=app.config.get("SES_AWS_SECRET_KEY"),
                      region=app.config.get("SES_REGION", "us-east-1"),
                      sender=app.config.get("SES_SENDER", None),
                      reply_to=app.config.get("SES_REPLY_TO", None),
                      template=app.config.get("SES_TEMPLATE", None),
                      template_context=app.config.get("SES_TEMPLATE_CONTEXT", {})
        )