惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
Threatpost
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
T
The Blog of Author Tim Ferriss
S
SegmentFault 最新的问题
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 司徒正美
T
Tailwind CSS Blog
The Cloudflare Blog
The Last Watchdog
The Last Watchdog
PCI Perspectives
PCI Perspectives
博客园 - 聂微东
Stack Overflow Blog
Stack Overflow Blog
TaoSecurity Blog
TaoSecurity Blog
云风的 BLOG
云风的 BLOG
C
Cybersecurity and Infrastructure Security Agency CISA
O
OpenAI News
Recorded Future
Recorded Future
GbyAI
GbyAI
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Y
Y Combinator Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
量子位
博客园 - 叶小钗
V
Vulnerabilities – Threatpost
F
Full Disclosure
Recent Announcements
Recent Announcements
Vercel News
Vercel News
S
Schneier on Security
H
Heimdal Security Blog
Cisco Talos Blog
Cisco Talos Blog
V2EX - 技术
V2EX - 技术
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
B
Blog RSS Feed
宝玉的分享
宝玉的分享
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
P
Privacy & Cybersecurity Law Blog
T
Threat Research - Cisco Blogs
G
Google Developers Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
爱范儿
爱范儿
IT之家
IT之家
大猫的无限游戏
大猫的无限游戏
C
Check Point Blog
N
Netflix TechBlog - Medium
S
Security @ Cisco Blogs
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Microsoft Azure Blog
Microsoft Azure Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Cyberwarzone
Cyberwarzone

夜行人

回家路上 第一期的直播演示项目 震动检测器 正能量 在线参观CodeLab Neverland 发布 CodeLab Adapter 3.3.1 DynamicTable 之 纸糊方向盘 CodeLab DynamicTable: 一个可实施的技术方案 CodeLab Insight 发布 Alpha 版 情人节 Home Assistant 周报 && IoT 周报 (02) Joplin: 关注隐私的 Evernote 开源替代软件 浏览器的未来与 Web 传感器 Home Assistant 周报 && IoT 周报 (01) 百宝箱(01) 论自由 介绍 WebThings Home Assistant 周报 && iot 周报 (00) 百宝箱(00) 毛姆读书心得 传世之作 周末徒步 CodeLab Adapter ❤️ Jupyter/Python 航班 躲雨 夏令营途中 [译]思想--作为一种技术 The future of coding 美国之行 三门问题的程序模拟 从Python转向Pharo https://blog.just4fun.site/post/iot/iot-open-source-projects/ Python异步编程笔记 https://blog.just4fun.site/post/iot/iot-open-source-hardware-community/ 万物积木化开发者社区 CodeLab ❤️ Blender Scratch3技术分析之云变量 API(第7篇) [译]对管道(Pipes)的偏爱 [译]提出正确的问题比得到正确答案更重要 蓝牙设备与Scratch3.0 创建你的第一个Scratch3.0 Extension Scratch3技术分析之项目内部数据(第6篇) Scratch3技术分析之社区 API(第5篇) Scratch3技术分析之User API(第4篇) Scratch3技术分析之项目主页API(第3篇) Scratch3技术分析之静态资源API(第2篇) Scratch3.0、micro:bit与Windows7 https://blog.just4fun.site/post/iot/zerynth-vs-micropython/ 核聚变、方所与半宅空间 可视化编程为何是个糟糕的主意 codelab.club周末聚会 关于codelab.club '下一件大事'是一个房间 Hungry Robot - Eat everything 编程作为一种思考方式 今日简史 史蒂夫·乔布斯传 罗素自选文集 https://blog.just4fun.site/post/edx/tianjin-scratch-ai/ https://blog.just4fun.site/post/edx/richie-cms-openedx/ 徒步武功山 WebUSB与micro:bit 积木化编程与3D场景 夜宿武功山顶 scratch3-adapter接入优必选Alpha系列机器人 https://blog.just4fun.site/post/edx/video-migration-note/ scratch3-adapter重构笔记 https://blog.just4fun.site/post/edx/edx-community-members/ 两种硬件编程风格的比较 使用micro:bit自制PPT翻页笔 柏拉图对话集 scratch3.0 + micro:bit 七月电影放映计划 非营利组织的管理 Screenly--用树莓派让任何屏幕变为可编程的数字标牌 以最佳实践开始你的Django项目 micro:bit与事件驱动 为Scratch3.0设计的插件系统(上篇) OCR应用一例 近两年读过的一些好书 blockly开发之使用python驱动浏览器中的turtle(2) 牛顿新传 文学理论入门 逻辑的引擎 人生的意义 blockly开发之生成并运行js代码(1) blockly开发之hello world(0) micro:bit使用笔记 神器之Termux https://blog.just4fun.site/post/iot/micropython-notes/ Cozmo what is this Scratch的前世今生 下段旅程 我行在远方 爆裂 途中杂记 https://blog.just4fun.site/post/edx/open-edx-startup/ cozmo系列之入门 - 有性格且可编程的机器人 PaperWeekly开发笔记 创业二三事
superset使用笔记
种瓜 · 2017-01-05 · via 夜行人

文章目录

superset马甲比较多,它曾经叫过:PanoramixCaravel

关于入门和介绍可以我此前的文章:

最近公司想用新版本中的SQL Lab的功能,于是我将caravel升级到superset。在此做个笔记

除了增加了几个新特性,变化不大,此前写的caveral文章基本可用,如果遇到问题,参考官方文档即可

安装

安装基本没坑,跟着官方教程做就行

我是ubuntu系统,所以安装过程为:

安装依赖

ubuntu

1
sudo apt-get install build-essential libssl-dev libffi-dev python-dev python-pip libsasl2-dev libldap2-dev

centos

1
2
3
4
yum makecache
sudo easy_install -i http://pypi.douban.com/simple/ pip
sudo easy_install pip
sudo yum install gcc libffi-devel python-devel python-pip python-wheel openssl-devel libsasl2-devel openldap-devel

docker

参考Docker image (community contributed)

安装与初始化

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
# Install superset
pip install superset -i http://pypi.douban.com/simple --trusted-host pypi.douban.com #我的版本是superset==0.15.1

# Create an admin user
fabmanager create-admin --app superset

# Initialize the database
superset db upgrade

# Load some data to play with
superset load_examples

# Create default roles and permissions
superset init

# Start the web server on port 8088
superset runserver -p 8088 -a 0.0.0.0 # -a 0.0.0.0使其允许外部访问

# To start a development web server, use the -d switch
# superset runserver -d 

数据永久化

默认数据库在~/.superset/superset.db,可通过在配置文件里修改SQLALCHEMY_DATABASE_URI来指定sqlite数据库文件路径

更多数据库

默认支持sqlite

如果需要添加其他数据库需要安装依赖:Database dependencies

诸如mssql: pip install pymssql

添加mssql,uri形如: mssql+pymssql://username:pass@192.168.0.6:10025/db_name?charset=utf8

oracle

oracle比较烦人,如果是ubuntu可以参考Oracle-Instant-Client

简单配置

配置方法和caravel系列之简易配置/定制相同,只需要把配置文件名由caravel_config.py改为superset_config.py即可

我的配置是:(superset_config.py) 记得:export PYTHONPATH=/xxx (superset_config.py所在目录)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#---------------------------------------------------------
# Caravel specific config
#---------------------------------------------------------
ROW_LIMIT = 5000
CARAVEL_WORKERS = 16

CARAVEL_WEBSERVER_PORT = 8000
#---------------------------------------------------------

#---------------------------------------------------------
# Flask App Builder configuration
#---------------------------------------------------------
# Your App secret key
SECRET_KEY = '\2\1thisismyscretkey\1\2\e\y\y\h'
LANGUAGES = "en"
APP_ICON = "your logo"
APP_NAME = "yout app name"

BABEL_DEFAULT_LOCALE = 'en'
LANGUAGES = {
      'zh': {'flag': 'cn', 'name': 'Chinese'},
      'en': {'flag': 'us', 'name': 'English'},
      'fr': {'flag': 'fr', 'name': 'French'},
      # 'fr': {'flag': 'fr', 'name': 'French'},

}
SQLALCHEMY_DATABASE_URI = 'sqlite:////home/wwj/superset_lab/superset.db' #存储superset的系统信息,改为你自己的数据库路径,默认在~/.superset

# Flask-WTF flag for CSRF
#CSRF_ENABLED = True

定制化

认证系统

考虑到数据的隐私和安全,访问superset的内容需要登陆验证,你可以加入公司已有的认证系统,诸如LDAP,database之类的,目前superset支持以下积累验证:database, OpenID, LDAP, OAuth & REMOTE_USER

这部分功能由Flask AppBuiler提供,如果你想做深度定制,可以对此做更深入了解:Authentication Methods

另外如果你想把superset的slice集成到其他系统会遇到用户登陆问题,如果你想无缝衔接,可以考虑OAuth

至于是否可以用CAS,我还没做实验,猜测在Flask AppBuiler的认证部分增加flask cas模块能做到

#坑

汉化

当前版本,打包过程没用把翻译文件放进去,需要手动处理

首先进入安装包目录(我的是:/home/wwj/superset_lab/env/lib/python3.4/site-packages/superset)

然后:mkdir -p translations/zh/LC_MESSAGES

接着获取:wget https://github.com/airbnb/superset/raw/0.15.1/superset/translations/zh/LC_MESSAGES/messages.mo

如果翻译不完整可以手动翻译: 下载: wget https://github.com/airbnb/superset/raw/0.15.1/superset/translations/zh/LC_MESSAGES/messages.po,校验:msgfmt -c messages.po, 然后编译为mo:msgunfmt messages.po -o messages.mo

如果想反向编译,即 mo -> po , 可以使用 :msgfmt xxx.mo -o xxx.po ,可以参考:How to convert gettext .mo file into .po file

如果你想做更多定制,诸如做自己的发行版,参考:Making your own build

文章作者 种瓜

上次更新 2017-01-05