Django - 安装Ckeditor

Posted 太古月石的博客

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Django - 安装Ckeditor相关的知识,希望对你有一定的参考价值。

1. Ckedior.js

 CKEDITOR.editorConfig = function( config ) {
    // config.filebrowserUploadUrl="/blog/upload_img/";
     config.extraPlugins = ‘codesnippet‘;
 };

这个是必须的。

2. settings.py

CKEDITOR_CONFIGS = {
    default: {
        extraPlugins: sourcedialog,codemirror,widget,lineutils,codesnippet,selectall,
        toolbar: Full,
    },
    zinnia-content: {
        toolbar_Zinnia: [
            [Cut, Copy, Paste, PasteText, PasteFromWord],
            [Undo, Redo],
            [Scayt],
            [Link, Unlink, Anchor],
            [CodeSnippet, Image, Table, HorizontalRule, SpecialChar],
            [Source],
            [Maximize],
            /,
            [Bold, Italic, Underline, Strike,
             Subscript, Superscript, -, RemoveFormat],
            [NumberedList, BulletedList, -,
             Outdent, Indent, -, Blockquote],
            [Styles, Format],
        ],
        toolbar: Zinnia,
    },
}

Done

 

以上是关于Django - 安装Ckeditor的主要内容,如果未能解决你的问题,请参考以下文章