SuperSet logo修改、导出csv中文乱码、sql查询超时问题解决(默认30s)问题处理

一、网页标题及logo修改

1、网页标题修改

需要修改两个文件:
vi /root/anaconda3/envs/super/lib/python3.6/site-packages/superset/views/core.py

return self.render_template(
'superset/basic.html',
entry='welcome',
title='Superset',
bootstrap_data=json.dumps(payload, default=utils.json_iso_dttm_ser),
)

说明:title='Superset' 为网页标题

vi /root/anaconda3/envs/super/lib/python3.6/site-packages/superset/config.py
# Superset specific config
APP_NAME = 'Superset'

说明:APP_NAME = 'Superset'为网页标题

2、修改logo图标和网页favicon图标:
cd /root/anaconda3/envs/super/lib/python3.6/site-packages/superset/static/assets/images/
网页favicon图标 favicon.png

网页title图标 s.png
logo图标 [email protected]

重启服务

 

二、superset导出csv中文乱码问题

superset 导出CSV 默认编码为utf-8,如果需要修改编码类型需要修改两个地方。
修改 vi /root/anaconda3/envs/super/lib/python3.6/site-packages/superset/config.py
CSV_EXPORT = {
#'encoding': 'utf-8',
'encoding': 'gbk',
}

修改vi /root/anaconda3/envs/super/lib/python3.6/site-packages/superset/views/core.py 找到
    csv = df.to_csv(index=False, **config.get('CSV_EXPORT'))
#response = Response(csv, mimetype='text/csv')
response = CsvResponse (csv, mimetype='text/csv')

说明:用CsvResponse 而不是Response

重启服务

三、sql查询超时问题解决 (默认30s)

vi /root/anaconda3/envs/super/lib/python3.6/site-packages/superset/config.py
# Timeout duration for SQL Lab synchronous queries
#SQLLAB_TIMEOUT = 30
SQLLAB_TIMEOUT = 600

参考:

导出csv乱码问题:https://www.jianshu.com/p/d9e402eb3bf4

修改logo:https://blog.csdn.net/qq_44775361/article/details/100672711

超时问题:https://blog.csdn.net/qq_34864753/article/details/93517511

你可能感兴趣的:(大数据)