Django CKEditor限制图像属性

问题描述

当前,我使用CKeditor允许用户撰写美观的帖子。现在,当我尝试集成图像选项时,我只希望用户上传图像,当我单击图像符号时它会显示 ImageInfo (让用户从服务器文件夹中选择图像),链接获取网络图像,上传以打开文件浏览器并让用户选择自己的浏览器,以及高级,我都不知道。

我只希望用户能够从他的计算机上载图像。如何停用其他属性? 这是我在settings.py中的配置:

CKEDITOR_CONfigS = {
    'default': {
        'width': '150%','toolbar': 'Custom',# Specify Custom Shit - GPL License -
        'toolbar_Custom': [
            ['Bold','Italic','Underline','-','Image','Link','CodeSnippet','NumberedList','BulletedList','HorizontalRule','Undo','Redo'],],'extraPlugins': 'codesnippet'
    }
}

解决方法

您可以使用此处提到的 removeDialogTabs 删除标签:

https://stackoverflow.com/a/47260647/14507752

CKEDITOR_CONFIGS = {
    'default': {
        'width': '150%','toolbar': 'Custom',# Specify Custom Shit - GPL License -
        'toolbar_Custom': [
            ['Bold','Italic','Underline','-','Image','Link','CodeSnippet','NumberedList','BulletedList','HorizontalRule','Undo','Redo'],],'extraPlugins': 'codesnippet'
        # Remove Dialog Tabs
        'removeDialogTabs': 'image:advanced;image:Link',}
}