Can't get CKEditor plugins to work in django

前端 未结 5 1808
后悔当初
后悔当初 2021-01-07 02:37

I am trying to get the CKEditor plugin, codesnippet, to work in the django admin but am unable to. CKEditor works if I don\'t define any CKEDIT_CONFIGS in my settings.py. It

5条回答
  •  粉色の甜心
    2021-01-07 03:15

    The Code Snippet plugin has various dependencies each of which has sub-dependencies, i.e.:

    • Widget (has Line Utilities as a sub-dependency amongst others)
    • Dialog (also has sub dependencies)

    I had to as a minimum add Code Snippet, Widget and Line Utils in the ckeditor/plugins path to get it to work, as well as use the following setting to get the button to show up in the toolbar.

    CKEDITOR_CONFIGS = {
       'default': {
            'toolbar':[ ['CodeSnippet', ], ],
            'height': 400,
            'width': 900,
            'removePlugins': 'stylesheetparser',
            'extraPlugins': 'codesnippet',
       },
    }
    

    So once all your plugin dependencies are all installed it should work.

提交回复
热议问题