{"id":21068360,"url":"https://github.com/n37r06u3/django-ckeditor5","last_synced_at":"2025-05-16T03:33:12.276Z","repository":{"id":57419300,"uuid":"173723477","full_name":"n37r06u3/django-ckeditor5","owner":"n37r06u3","description":"CKEditor5 Django集成","archived":false,"fork":false,"pushed_at":"2019-03-18T10:45:36.000Z","size":947,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-11-18T16:05:56.565Z","etag":null,"topics":["ckeditor5","django"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/n37r06u3.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-03-04T10:26:31.000Z","updated_at":"2021-03-30T02:10:28.000Z","dependencies_parsed_at":"2022-09-13T15:28:01.260Z","dependency_job_id":null,"html_url":"https://github.com/n37r06u3/django-ckeditor5","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n37r06u3%2Fdjango-ckeditor5","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n37r06u3%2Fdjango-ckeditor5/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n37r06u3%2Fdjango-ckeditor5/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n37r06u3%2Fdjango-ckeditor5/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/n37r06u3","download_url":"https://codeload.github.com/n37r06u3/django-ckeditor5/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225403453,"owners_count":17468971,"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","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":["ckeditor5","django"],"created_at":"2024-11-19T18:20:04.577Z","updated_at":"2024-11-19T18:20:06.418Z","avatar_url":"https://github.com/n37r06u3.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Django CKEditor 5\n===\n\n# 介绍 #\n本项目整合了新版 [CKEditor 5](https://ckeditor.com/ckeditor-5/) 到Django. 老版本[django-ckeditor](https://github.com/django-ckeditor/django-ckeditor) 仍然在使用[CKEditor 4](https://ckeditor.com/ckeditor-4/). \n\n根据 [ckeditor.com](https://ckeditor.com/docs/ckeditor5/latest/builds/guides/migrate.html)官方说明，CKEditor 5是一个你没有用过的船新版本。\n\n整体上仍然使用 [django-ckeditor](https://github.com/django-ckeditor/django-ckeditor/tree/master/ckeditor)项目的架构。不同点是：\n\n- `static/ckeditor5` 包含最新的CKEditor 5经典编辑器（版本会随时更新，尽量与官方同步），[CKEditor 5下载](https://ckeditor.com/ckeditor-5/download/).\n- 移除了`extraPlugins`，老的一些插件，如代码插入编辑，目前不可以使用，需要其他方案。\n- 修改了`static/ckeditor5/ckeditor-init.js`部分代码， 在 `initialiseCKEditor` 方法里:\n    + extraPlugins处理方法代码被删除\n    + CKEditor 5 使用 `ClassicEditor.create` 来初始化创建编辑器，而不是用4的 `CKEDITOR.replace`\n\n# 安装 #\npip install django-ckeditor5\n\n升级\npip install django-ckeditor5 -U \n\ngithub\npip install git+https://github.com/n37r06u3/django-ckeditor5\n\n# 配置 #\n添加app\n```\nINSTALLED_APPS = [\n    ...\n    'ckeditor5'\n]\n```\n基础配置\n```\nCKEDITOR5_CONFIGS = {\n    'default': {\n        'toolbar': [\"undo\", \"redo\", \"bold\", \"italic\", \"blockQuote\", \"imageTextAlternative\", \"imageUpload\", \"heading\",\n                    \"imageStyle:full\", \"imageStyle:side\", \"link\", \"numberedList\", \"bulletedList\"],\n        'height': '300px',\n        'width': '100%',\n    },\n}\n```\n模型定义\n```\nfrom ckeditor5.fields import RichTextField\n```\n\n\n添加插件\nhttps://www.npmjs.com/package/ckeditor5-code-block\n\n\n\n# 测试 #\n下载源码解压\ncd ckeditor5_demo\n\npython manage.py migrate\n\npython manage.py createsuperuser\n\npython manage.py runserver\n\nhttp://127.0.0.1:8000/admin/\n\n# 参考 #\nhttps://github.com/django-ckeditor/django-ckeditor\n\nhttps://ckeditor.com/ckeditor-4/\n\nhttps://github.com/pancodia/django-ckeditor5\n\nhttps://ckeditor.com/ckeditor-5/\n\n# 变更 #\n\n20190304 - v0.0.1 初始化项目 CKEditor 5集成v11.0.1, 新版本django2.1.7测试可用\n\n20190305 - v0.0.2 添加demo\n\n20190306 - v0.0.3 添加大小配置\n\n20190306 - v0.0.4 ckeditor5-build-classic11.0.1到v12.0.0 添加 https://www.npmjs.com/package/ckeditor5-code-block\n\n# TODO #\n添加图片上传插件\n\n添加html源码查看插件\n\n完善安装说明\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fn37r06u3%2Fdjango-ckeditor5","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fn37r06u3%2Fdjango-ckeditor5","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fn37r06u3%2Fdjango-ckeditor5/lists"}