[Wiki](https://gitee.com/smartchart/django_smartchart/wikis/pages) \| [Community](https://www.smartchart.cn/) \| [Sponsors](https://www.smartchart.cn/) \| [GitHub](https://github.com/JohnYan2017/Echarts-Django) \| [Gitee](https://gitee.com/smartchart/django_smartchart)
A platform that Connect Data to Echarts.
------------------------------------------------------------------------------- [**English Documentation**](README-EN.md) ------------------------------------------------------------------------------- ## 简介 - SmartChart是基于Echarts的微代码开发平台,适用于任何WEB项目,比拖拽开发更方便 - 简单, 敏捷, 高效,通用化, 高度可定制化, 让你的项目瞬间档次提升 - 完全真正打通前后端, 图形数据联动, 筛选开发毫无压力 - 积木式的开发模式, 开箱即用, 安装简单, 依赖少, 适应各种平台 - 我们让简单和通用化不再是个矛盾体, 请加入我们共建生态, Like it Star it    ### 安装使用说明: - 环境准备: 官方[最新Python下载链接](https://www.python.org/downloads/release/python-390/ "最新Python下载链接") 如果下载太慢, 可以到[淘宝镜象下载](https://npm.taobao.org/mirrors/python/3.9.0/ "淘宝镜象下载") 也可以直接下载[WINDOWS64位安装版](https://npm.taobao.org/mirrors/python/3.9.0/python-3.9.0-amd64.exe "WINDOWS64位安装版") [MAC电脑安装版](http://npm.taobao.org/mirrors/python/3.9.0/python-3.9.0rc2-macosx10.9.pkg "MAC电脑安装版") - [Window平台安装视屏介绍](https://www.ixigua.com/6901867671193649668/ "Window平台安装视屏介绍") #### 如果你是非Python语言的开发者 ```shell script 你可以把smartchart当作服务来嵌入你的页面使用 1. 安装Python环境(参考上面的环境准备) 2. 命令行安装: pip3 install smartchart pip3 install smartchart -U (升级) # Mac or Linux 初始化方法 3. 初始化DB, 命令行输入 smartchart makemigrations smartchart migrate 4. 建立管理员帐号, 如果已有可忽略 smartchart createsuperuser 5. 本地命令行启动: smartchart 如果你需要远程访问,启动方式: smartchart runserver 0.0.0.0:8000 --insecure 6. 访问http://127.0.0.1:8000/echart/init_db/ 进行数据初始化 # Window 初始化方法 3. 初始化DB, 你需要找到你的python安装地址,不记得了参考下图方法 如C:\Users\xxx\AppData\Local\Programs\Python\Python39 命令行输入 cd C:\Users\....\Python39\Scripts\ python smartchart makemigrations python smartchart migrate 4. 建立管理员帐号, 如果已有可忽略 python smartchart createsuperuser 5. 本地命令行启动: python smartchart 如果你需要远程访问 启动方式: python smartchart runserver 0.0.0.0:8000 --insecure 6. 访问http://127.0.0.1:8000/echart/init_db/ 进行数据初始化 ``` **访问首页http://127.0.0.1:8000** **开发前建意新建一个非超级管理员帐号(重要),避免改到内置的数据集和图形** **并观看视屏说明!!!** - [SQL与图形联动视屏教程](https://www.ixigua.com/6902584882958959116/ "SQL与图形联动视屏教程") - [基础操作视屏教程](https://www.ixigua.com/6882218819964797447/ "基础操作视屏教程") ```python # 如果需要,你可以采用单点登录的方式与smartchart进行对接嵌入 # 各种语言的对接源码可以在对应的xxxInterface中找到,欢迎PULL '/echart/smart_login?id=xxx&stamp=xxx&token=xxx&url=/' ''' 参数说明: id: 用户名(在smartchart平台中管理) stamp: 时间戳(1970年1月1日到生成时间的毫秒数) token: 采用sha1加密, token=SHA1(链接秘钥+stamp+id) 链接秘钥默认smartchart, 请在环境变量设定SMART_KEY替换(重要) url: 登录成功后跳转链接 ''' ``` **提示:为了数据安全,对外生产环境使用,务必设定你的环境变量SMART_KEY** #### 如果你是python开发者,可以在django项目中当作apps使用 ```shell script pip install smartchart 简单配置一下, 你可以参考此demo 1. 在你的setting.py的INSTALL_APPS中加入'smart_chart.echart' 2. MIDDLEWARE 中注释掉XFrameOptionsMiddleware 3. setting.py中设定为中国时区, 支持中文基础平台建设! LANGUAGE_CODE = 'zh-hans' TIME_ZONE = 'Asia/Shanghai' USE_I18N = True USE_L10N = True USE_TZ = False # 此处必须为False 4. 在你的url.py中加入引用 from django.conf.urls import include from django.views.generic import RedirectView 5. url.py的urlpatterns中加入路由 path('echart/', include('smart_chart.echart.urls')), path('', RedirectView.as_view(url='echart/index/')), #首页,可自定义路由 6. 初始化DB, 命令行输入: python manage.py makemigrations python manage.py migrate 7. 建立管理员帐号, 如果已有可忽略 python manage.py createsuperuser 8. 启动服务 python manage.py runserver 9. 访问http://127.0.0.1:8000/echart/init_db/ 进行数据初始化 ``` ##### 图形样列参考 - [SmartChart图形样列](https://www.smartchart.cn/echart/show/ "图形样列") - [SmartChart仪表盘样列](https://www.smartchart.cn/index/ "项目样列") #### 安装及使用问题,微信群有时效性,加以下微信号拉你入群