创建 首页
class MyIndexView(IndexView):
@expose('/')
def index(self):
return redirect('/superset/welcome')
#创建appbuilder 应用
appbuilder = AppBuilder(
app, db.session,
base_template='superset/base.html',
indexview=MyIndexView,
security_manager_class=app.config.get("CUSTOM_SECURITY_MANAGER"))
#创建sm属性
sm = appbuilder.sm
#获取get_session
get_session = appbuilder.get_session
results_backend = app.config.get("RESULTS_BACKEND")
# Registering sources
module_datasource_map = app.config.get("DEFAULT_MODULE_DS_MAP")
module_datasource_map.update(app.config.get("ADDITIONAL_MODULE_DS_MAP"))
ConnectorRegistry.register_sources(module_datasource_map)