前言
smartchart是一个数据可视化展示大屏解决方案,可以以低代码甚至无代码的方式开发一个数据展示大屏。官方样例:
更多可参考地址:https://gitee.com/smartchart/django_smartchart
在实际使用过程中发现,smartchart直接使用时很多静态资源链接使用了官方资源,导致在内网环境部署时会无法使用。所以需要将静态资源替换成本地资源。
参考步骤
- clone gitee上的项目代码
git clone https://gitee.com/smartchart/django_smartchart.git
- 修改项目目录下的
django_smartchart
目录下的settings.py
,在文件末尾添加如下代码指定静态资源目录:
STATICFILES_DIRS = [
os.path.join(BASE_DIR, 'static'),
]
- 修改html中写死的静态资源地址,我这边是直接搜索替换:在template目录下搜索地址
https://www.smartchart.cn/static
, 将上述地址替换为空,即将https://www.smartchart.cn/static/static/index/dialog.css
替换为/static/index/dialog.css
- 运行项目,检查是否有访问不到的资源,有的话将地址拷贝出来,使用原地址下载后放在static目录下即可。