'Will initialize the Flask app, supporting the app factory pattern.
:param app:
:param session: The SQLAlchemy session'

def init_app(self, app, session):

    app.config.setdefault('APP_NAME', 'F.A.B.')
    app.config.setdefault('APP_THEME', '')
    app.config.setdefault('APP_ICON', '')
    app.config.setdefault('LANGUAGES', {'en': {'flag': 'gb', 'name': 'English'}})
    app.config.setdefault('ADDON_MANAGERS', [])
    if (self.security_manager_class is None):
        from flask_appbuilder.security.sqla.manager import SecurityManager
        self.security_manager_class = SecurityManager
    self._addon_managers = app.config['ADDON_MANAGERS']
    self.session = session
    self.sm = self.security_manager_class(self)
    self.bm = BabelManager(self)
    self._add_global_static()
    self._add_global_filters()
    app.before_request(self.sm.before_request)
    self._add_admin_views()
    self._add_addon_views()
    self._add_menu_permissions()
    if (not self.app):
        for baseview in self.baseviews:
            self._check_and_init(baseview)
            self.register_blueprint(baseview)
            self._add_permission(baseview)
    self._init_extension(app)
