{"id":24076677,"url":"https://github.com/kinegratii/django-echarts","last_synced_at":"2025-10-25T03:39:15.087Z","repository":{"id":23331099,"uuid":"98728999","full_name":"kinegratii/django-echarts","owner":"kinegratii","description":"基于pyecharts和django的可视化网站脚手架。","archived":false,"fork":false,"pushed_at":"2024-06-20T18:12:17.000Z","size":6305,"stargazers_count":294,"open_issues_count":6,"forks_count":74,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-09-30T13:06:04.416Z","etag":null,"topics":["django","echarts","pyecharts"],"latest_commit_sha":null,"homepage":"https://django-echarts.readthedocs.io/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kinegratii.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-07-29T11:45:17.000Z","updated_at":"2025-09-12T22:18:27.000Z","dependencies_parsed_at":"2024-06-21T15:34:56.137Z","dependency_job_id":"09377991-33b4-4715-a4aa-5a6a5357a98f","html_url":"https://github.com/kinegratii/django-echarts","commit_stats":{"total_commits":282,"total_committers":1,"mean_commits":282.0,"dds":0.0,"last_synced_commit":"12de6cf4faab1ecbbc06bd487727cc16791ee556"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"purl":"pkg:github/kinegratii/django-echarts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kinegratii%2Fdjango-echarts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kinegratii%2Fdjango-echarts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kinegratii%2Fdjango-echarts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kinegratii%2Fdjango-echarts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kinegratii","download_url":"https://codeload.github.com/kinegratii/django-echarts/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kinegratii%2Fdjango-echarts/sbom","scorecard":{"id":560641,"data":{"date":"2025-08-11","repo":{"name":"github.com/kinegratii/django-echarts","commit":"12de6cf4faab1ecbbc06bd487727cc16791ee556"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.3,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/6 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/unittest.yaml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/unittest.yaml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/kinegratii/django-echarts/unittest.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/unittest.yaml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/kinegratii/django-echarts/unittest.yaml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/unittest.yaml:42: update your workflow using https://app.stepsecurity.io/secureworkflow/kinegratii/django-echarts/unittest.yaml/master?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/unittest.yaml:27","Warn: pipCommand not pinned by hash: .github/workflows/unittest.yaml:28","Warn: pipCommand not pinned by hash: .github/workflows/unittest.yaml:29","Warn: pipCommand not pinned by hash: .github/workflows/unittest.yaml:30","Warn: pipCommand not pinned by hash: .github/workflows/unittest.yaml:31","Warn: pipCommand not pinned by hash: .github/workflows/unittest.yaml:32","Warn: pipCommand not pinned by hash: .github/workflows/unittest.yaml:33","Warn: pipCommand not pinned by hash: .github/workflows/unittest.yaml:34","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned","Info:   0 out of   8 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact v0.6.0 not signed: https://api.github.com/repos/kinegratii/django-echarts/releases/95931407","Warn: release artifact v0.5.2 not signed: https://api.github.com/repos/kinegratii/django-echarts/releases/66303676","Warn: release artifact v0.5.1 not signed: https://api.github.com/repos/kinegratii/django-echarts/releases/64041427","Warn: release artifact v0.5.0 not signed: https://api.github.com/repos/kinegratii/django-echarts/releases/62152024","Warn: release artifact v0.6.0 does not have provenance: https://api.github.com/repos/kinegratii/django-echarts/releases/95931407","Warn: release artifact v0.5.2 does not have provenance: https://api.github.com/repos/kinegratii/django-echarts/releases/66303676","Warn: release artifact v0.5.1 does not have provenance: https://api.github.com/repos/kinegratii/django-echarts/releases/64041427","Warn: release artifact v0.5.0 does not have provenance: https://api.github.com/repos/kinegratii/django-echarts/releases/62152024"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 29 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"27 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2022-190 / GHSA-2gwj-7jmv-h26r","Warn: Project is vulnerable to: PYSEC-2023-13 / GHSA-2hrw-hx67-34x6","Warn: Project is vulnerable to: PYSEC-2022-1 / GHSA-53qw-q765-4fww","Warn: Project is vulnerable to: PYSEC-2021-98 / GHSA-68w8-qjq3-2gfm","Warn: Project is vulnerable to: PYSEC-2022-20 / GHSA-6cw3-g6wv-c2xv","Warn: Project is vulnerable to: PYSEC-2023-225 / GHSA-7h4p-27mh-hmrw","Warn: Project is vulnerable to: GHSA-7xr5-9hcq-chf9","Warn: Project is vulnerable to: PYSEC-2022-2 / GHSA-8c5j-9r9f-c6w8","Warn: Project is vulnerable to: PYSEC-2022-245 / GHSA-8x94-hmjh-97hq","Warn: Project is vulnerable to: PYSEC-2022-19 / GHSA-95rw-fx8r-36v6","Warn: Project is vulnerable to: PYSEC-2023-226 / GHSA-h8gc-pgj2-vjm3","Warn: Project is vulnerable to: PYSEC-2023-100 / GHSA-jh3w-4vvf-mjgr","Warn: Project is vulnerable to: PYSEC-2022-3 / GHSA-jrh2-hc4r-7jwx","Warn: Project is vulnerable to: PYSEC-2022-213 / GHSA-p64x-8rxx-wf6q","Warn: Project is vulnerable to: PYSEC-2021-99 / GHSA-p99v-5w3c-jqq9","Warn: Project is vulnerable to: PYSEC-2023-12 / GHSA-q2jf-h9jm-m7p4","Warn: Project is vulnerable to: PYSEC-2021-8 / GHSA-qm57-vhq3-3fwf","Warn: Project is vulnerable to: PYSEC-2023-222 / GHSA-qmf9-6jqf-j8fq","Warn: Project is vulnerable to: PYSEC-2022-304 / GHSA-qrw5-5h28-6cmg","Warn: Project is vulnerable to: PYSEC-2023-61 / GHSA-r3xc-prgr-mg9p","Warn: Project is vulnerable to: GHSA-rrqc-c2jx-6jgv","Warn: Project is vulnerable to: PYSEC-2021-7 / GHSA-rxjp-mfm9-w4wr","Warn: Project is vulnerable to: PYSEC-2021-439 / GHSA-v6rh-hp5x-86rv","Warn: Project is vulnerable to: PYSEC-2024-47 / GHSA-vm8q-m57g-pff3","Warn: Project is vulnerable to: PYSEC-2022-191 / GHSA-w24h-v9qh-8gxj","Warn: Project is vulnerable to: PYSEC-2021-109 / GHSA-xpfp-f569-q3p2","Warn: Project is vulnerable to: PYSEC-2024-28 / GHSA-xxj9-f6rv-m3x4"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-20T13:34:10.274Z","repository_id":23331099,"created_at":"2025-08-20T13:34:10.274Z","updated_at":"2025-08-20T13:34:10.274Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280901463,"owners_count":26410586,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-25T02:00:06.499Z","response_time":81,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["django","echarts","pyecharts"],"created_at":"2025-01-09T20:00:09.241Z","updated_at":"2025-10-25T03:39:15.053Z","avatar_url":"https://github.com/kinegratii.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# django-echarts\n\n![django-echarts version](https://img.shields.io/pypi/v/django-echarts.svg) ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/django-echarts.svg) ![PyPI - Django Version](https://img.shields.io/pypi/djversions/django-echarts.svg) [![unittest](https://github.com/kinegratii/django-echarts/actions/workflows/unittest.yaml/badge.svg)](https://github.com/kinegratii/django-echarts/actions/workflows/unittest.yaml) [![codecov](https://codecov.io/gh/kinegratii/django-echarts/branch/master/graph/badge.svg?token=B7ba489op8)](https://codecov.io/gh/kinegratii/django-echarts)\n\n\n\n\u003e A visual site scaffold based on pyecharts and django.\n\ndjango-echarts 是一个基于[pyecharts](https://github.com/pyecharts/pyecharts) 和 [Django](https://www.djangoproject.com) 整合的可视化网站脚手架。\n\n## 概述(Summary)\n\ndjango-echarts 主要提供了以下的内容：\n\n- 支持 90%+的pyecharts图表类型\n- 页面：主页 / 列表 / 详情 / 关于 / 设置 \n- 组件：导航栏 / 网站底部栏 / 热门板块 / 列表 / 合辑 /  关于面板 \n- UI主题：Bootstrap3 / Bootstrap5 / Material ，支持更换颜色模式\n- 可灵活扩展: 支持整合 Django用户认证 / 数据库 / Session \n- 基于Django Template Engine 的后端渲染\n- js/css静态文件托管，支持在线/本地切换\n- 生产力工具：代码生成器 / 静态文件下载器\n- 90%+ Python Typing Hints覆盖\n- 单元测试和85%+代码覆盖率\n\n## 安装(Install)\n\ndjango-echarts的运行环境要求如下：\n\n| django-echarts版本系列 | pyecharts \u0026 echarts | django | python |\n| ------ | ------ | ----- | ----- |\n| 0.6.x | 1.9 / 4.8.0 | 2.0 - 4.1 | 3.7+ |\n|  | 2.0 / 5.4.1 | 2.0 - 4.1 | 3.7+ |\n| 0.5.x | 1.9 | 2.0 - 4.0 | 3.7+ |\n\n可以使用 pip 命令安装。\n\n```shell\npip install django-echarts\n```\n\n在 *requirements.txt* 引用 django-charts时，推荐使用 **固定次版本号** 的方式。\n\n```\ndjango-echarts~=0.6\n```\n\n## 3分钟上手(Quickstart in 3 Minutes)\n\n**1.** 创建Django项目。\n\n```shell\ndjango-admin startproject MyDemo\n```\n\n项目目录结构如下：\n\n```text\nMyDemo\n  |-- MyDemo\n        |-- __init__.py\n        |-- asgi.py\n        |-- settings.py\n        |-- urls.py\n        |-- site_views.py\n        |-- wsgi.py\n  |-- manage.py\n```\n\n**2.** 添加 django_echarts包和对应的主题包到项目配置模块的 `INSTALL_APPS`列表。\n\n```python\nINSTALL_APPS = (\n    # Your apps\n    'django_echarts',\n    'django_echarts.contrib.bootstrap5'\n    # Your apps\n)\n```\n\n**3.** 创建新文件 *site_views.py* ，输入下列代码。\n\n```python\n# ...\nfrom django_echarts.starter.sites import DJESite\nfrom django_echarts.entities import Copyright\nfrom pyecharts import options as opts\nfrom pyecharts.charts import Bar\n\nsite_obj = DJESite(site_title='福建统计')\n\nsite_obj.add_widgets(copyright_=Copyright(start_year=2022, powered_by='Zinc'))\n\nchart_description = '截止2020年底，福建省土地面积1240.29万公顷，占我国国土总面积1.3%。全省森林面积811.58万公顷，森林覆盖率为66.8%，连续42年位居全国首位。\n\n@site_obj.register_chart(title='森林覆盖率', description = chart_description, catalog='基本信息')\ndef fujian_forest_coverage():\n    bar = Bar().add_xaxis(\n        ['福州', '厦门', '莆田', '三明', '漳州', '泉州', '南平', '龙岩', '宁德']\n    ).add_yaxis(\n        '森林覆盖率', [54.7, 45, 58.1, 76.8, 63.4, 61, 75.3, 78, 75]\n    ).set_global_opts(\n        title_opts=opts.TitleOpts(title=\"福建省各地市森林覆盖率\", subtitle=\"单位：%\"),\n        visualmap_opts=opts.VisualMapOpts(is_show=True, max_=100, min_=0)).set_series_opts(\n        markline_opts=opts.MarkLineOpts(\n            data=[\n                opts.MarkLineItem(y=66.8, name=\"全省\"),\n            ]\n        )\n    )\n    return bar\n```\n\n在函数`fujian_forest_coverage` 中编写pycharts代码，返回对应的图表对象。\n\n根据需要修改文字显示，添加组件等。\n\n**4.** 在项目的路由模块 *urls.py* 添加挂载点。\n\n\n```python\nfrom django.conf.urls import url, include\nfrom django.urls import path\n\nfrom .site_views import site_obj\n\nurlpatterns = [\n    # Your urls\n    path('', include(site_obj.urls))\n]\n```\n\n**5.** 启动开发服务器，打开浏览器预览结果。\n\n```text\npython manage.py runserver 0.0.0.0:8900\n```\n\n运行效果（下图已添加其他组件）\n\n![fujian-forest-coverage](docs/images/fujian-forest-coverage.png)\n\n## 文档(Document)\n\n[在线文档](https://django-echarts.readthedocs.io/)\n\nBuild on [Material for MkDocs](https://squidfunk.github.io/mkdocs-material/)\n\n## 示例项目(Demo Project)\n\n在线示例 [https://zinc.pythonanywhere.com](https://zinc.pythonanywhere.com) \n\n参见项目 [kinegratii/zinc](https://github.com/kinegratii/zinc) 。\n\n## 截图(Screen Shots)\n\n**Home with ValuesPanel (bootstrap5)**\n\n![home_with_values_panel](docs/images/home_with_values_panel.png)\n\n**Chart Detail Page (bootstrap3.paper)**\n\n![chart_fj-map-gdp](docs/images/chart_fj-map-gdp.png)\n\n\n\n## 开源协议(License)\n\nMIT License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkinegratii%2Fdjango-echarts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkinegratii%2Fdjango-echarts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkinegratii%2Fdjango-echarts/lists"}