配置superset
配置
在配置应用之前,你需要创建一个配置文件:superset_config.py,并将其添加到PythonPath中(python路径)。以下有一些参数,你可以配置到该文件中:
# Superset specific config
# 行数限制、web服务端口配置
ROW_LIMIT = 5000
SUPERSET_WEBSERVER_PORT = 8088
# Flask App Builder configuration
# Your App secret key
# 密钥
SECRET_KEY = '\2\1thisismyscretkey\1\2\e\y\y\h'
# The SQLAlchemy connection string to your database backend
# This connection defines the path to the database that stores your
# superset metadata (slices, connections, tables, dashboards, ...).
# Note that the connection information to connect to the datasources
# you want to explore are managed directly in the web UI
# SQLAlchemy连接用以连接后台数据库,该连接定义了存储superset元数据的数据库的路径。需要注意的是,目标数据源的连接信息是直接从web UI上去操作管理的。
SQLALCHEMY_DATABASE_URI = 'sqlite:path/to/superset.db'
# Flask-WTF flag for CSRF
# 此处启用,设置为False以禁用所有CSRF保护,CSRF:跨站请求伪造
WTF_CSRF_ENABLED = True
# Add endpoints that need to be exempt from CSRF protection
# 添加需要从CSRF保护中豁免的端点
WTF_CSRF_EXEMPT_LIST = []
# A CSRF token that expires in 1 year
# CSRF令牌有效期为一年
WTF_CSRF_TIME_LIMIT = 60 * 60 * 24 * 365
# Set this API key to enable Mapbox visualizations
# 设置此API键以启用Mapbox可视化
MAPBOX_API_KEY = ''
所有参数及默认值可参考
https://github.com/apache/incubator-superset/blob/master/superset/config.py
你可以在你本地的superset_config.py中变更。
管理员通常会阅读该配置文件,以便了解哪些项以及默认值需要配置。
由于superset_config.py扮演了flask的一个配置模块,因此该文件将会影响到flask自身以及扩展功能的设置,如:flask-wtf, flask-cache, flask-migrate, and flask-appbuilder。Flask App构建器,SuperSet使用的web框架,提供了很多的配置设置信息。详询:
Flask App Builder Documentation
以了解更多如何配置的信息。
必须要修改的有:
SQLALCHEMY_DATABASE_URI: by default it is stored at ~/.superset/superset.db
SECRET_KEY: to a long random string
如果你需要豁免某些端点(例如:你正在运行认证回传的端点),你可以将端点加入到:WTF_CSRF_EXEMPT_LIST,如下:
WTF_CSRF_EXEMPT_LIST = [‘’]
在WSGI(Web服务器网关接口)服务器上运行
未完待续
在负载均衡下的配置
未完待续
自定义OAuth2配置
未完待续
功能标志
未完待续
SIP 15(superset提升方案15)
未完待续