django-blog-zinnia添加文本编辑器ckeditor
来源:互联网 发布:怎么下载word2010软件 编辑:程序博客网 时间:2024/06/05 20:47
CKEditor文本编辑器是一款旨在简化Web内容编辑的即用(ready for use)的HTML文本编辑器。它是一款所见即所得(WYSIWYG)的编辑器,涵盖了常用的文本编辑功能。CKEditor是一款开源的应用,也就是说开发者可以根据实际需求修改源码。下面是CKEditor的实例
这是一个CKEditor的实例。
django-blog-zinnia的生态系统提供了对ckeditor编辑器的支持
具体配置过程如下:
一、配置django-ckeditor:
1. 从https://github.com/shaunsephton/django-ckeditor/下载django-ckeditor的源码压缩包,解压后将ckeditor目录拷贝至django项目的工程目录下
2. 在settings.py文件的INSTALLED_APPS数组中添加ckeditor
3. 执行collectstatic管理命令manage.py collectstatic(或者将django-ckeditor源码目录/static/下的/ckeditor/手工拷贝至django工程项目的静态文件目录STATIC_ROOT下)
4. 在项目配置文件settings.py中添加CKEDITOR_UPLOAD_PATH配置,由此指定CKEditor的媒体上传路径,CKEditor使用Django的存储API。缺省设置下Django使用文件系统储存后端(使用MEDIA_ROOT和MEDIA_URL),如果没有另外指定存储后端,你需要对MEDIA_ROOT下的CKEDITOR_UPLOAD_PATH路径拥有写权限。
5. 在项目urls.py文件中新增CKEditor的URL配置:
(r'^ckeditor/', include('ckeditor.urls')),
6. 设置CKEDITOR_IMAGE_BACKEND来启用CKEditor缩略图,缺省设置下图像不显示缩略图,以全尺寸形式展现。
二、配置zinnia-wysiwyg-ckeditor:
1. 从https://github.com/django-blog-zinnia/zinnia-wysiwyg-ckeditor下载zinnia-wysiwyg-ckeditor源码压缩包,解压后将zinnia_ckeditor拷贝到django项目的工程目录下 2. 在settings.py文件的INSTALLED_APPS数组中添加zinnia_ckeditor(添加到zinnia之后)
三、修改zinnia WYSIWYG配置:
修改zinnia/settings.py文件的WYSIWYG_MARKUP_MAPPING字典,变更为如下内容:
WYSIWYG_MARKUP_MAPPING = { 'textile': 'markitup', 'markdown': 'markitup', 'restructuredtext': 'markitup', 'html': 'ckeditor'}
四、CKEditor参数配置:
在django项目目录的settings.py中添加变量CKEDITOR_CONFIGS,例如:
CKEDITOR_CONFIGS = { 'default': { 'skin': 'moono', 'toolbar': 'Full', 'toolbarGroups' : [ { 'name': 'clipboard', 'groups': [ 'clipboard', 'undo' ] }, { 'name': 'editing', 'groups': [ 'find', 'selection', 'spellchecker' ] }, { 'name': 'links' }, { 'name': 'insert' }, { 'name': 'forms' }, { 'name': 'tools' }, { 'name': 'document', 'groups': [ 'mode', 'document', 'doctools' ] }, { 'name': 'others' }, '/', { 'name': 'basicstyles', 'groups': [ 'basicstyles', 'cleanup' ] }, { 'name': 'paragraph', 'groups': [ 'list', 'indent', 'blocks', 'align', 'bidi' ] }, { 'name': 'styles' }, { 'name': 'colors' }, { 'name': 'about' }, ], 'width' : 960, 'height' : 380, 'removeButtons' : 'Underline,Subscript,Superscript', 'format_tags' : 'p;h1;h2;h3;pre', 'removeDialogTabs' : 'image:advanced;link:advanced', 'extraPlugins' : 'sourcedialog,codemirror,widget,lineutils,codesnippet,selectall', 'codemirror' : { 'theme': 'default', 'lineNumbers': True, 'lineWrapping': True, 'matchBrackets': True, 'autoCloseTags': True, 'autoCloseBrackets': True, 'enableSearchTools': True, 'enableCodeFolding': True, 'enableCodeFormatting': True, 'autoFormatOnStart': False, 'autoFormatOnModeChange': False, 'autoFormatOnUncomment': False, 'highlightActiveLine': True, 'mode': 'htmlmixed', 'showSearchButton': True, 'showTrailingSpace': True, 'highlightMatches': True, 'showFormatButton': True, 'showCommentButton': True, 'showUncommentButton': True, 'showAutoCompleteButton': True }, 'allowedContent' : True, },}
- django-blog-zinnia添加文本编辑器ckeditor
- python django-blog-zinnia
- 在 Django Model 中添加富文本编辑器 CKEditor
- Django-blog-zinnia初体验(一)
- 使用 django-blog-zinnia 搭建个人博客
- django添加富文本编辑器
- python之django-blog-zinnia 搭建个人博客
- CKeditor 在线文本编辑器
- 后台文本编辑器CkEditor
- 文本编辑器CKEditor使用
- Ckeditor在线文本编辑器
- ckeditor文本编辑器应用
- 富文本编辑器CKEditor
- ckeditor文本编辑器
- 富文本编辑器CKeditor
- 在web项目中添加文本编辑器 ckeditor
- 为Django添加富文本编辑器TinyMCE
- Django Admin:添加富文本编辑器kindeditor
- switch 另类写法
- 双屏扩展桌面类软件,展示界面位置不正确,或相反,如何解决?
- Java获得任意年份二月份的天数的方法
- 二级物料处理程序,中(品尝ABAP的味道)
- STL(五):非变动性算法源代码分析与使用示例( for_each、min_element 、find_if、search 等)
- django-blog-zinnia添加文本编辑器ckeditor
- Android四大组件之Activity
- 插入排序C语言实现
- STL(六):变动性算法源代码分析与使用示例(copy_backward、 transform、 replace_copy_if 等)
- 2015开篇
- GGS.INI详解
- Github Git Cheat Sheet
- PB中取得数据窗口所有列名以及列标题名称
- QuickContactBadge去掉三角