Django Ckeditor-禁用图像复制粘贴

Django Ckeditor-禁用图像复制粘贴,ckeditor,image-upload,django-ckeditor,Ckeditor,Image Upload,Django Ckeditor,我在我的模型中使用RichTextUploadField并粘贴google文档中的内容。我已使用forceAsPlainText从内容中删除格式。问题是,当我从文档中复制图像时,源中的URL是google drive的,而不是从我的服务器机器 CKEDITOR_UPLOAD_PATH = "uploads/" CKEDITOR_IMAGE_BACKEND = "pillow" CKEDITOR_CONFIGS = { "default&q

我在我的模型中使用RichTextUploadField并粘贴google文档中的内容。我已使用forceAsPlainText从内容中删除格式。问题是,当我从文档中复制图像时,源中的URL是google drive的,而不是从我的服务器机器

CKEDITOR_UPLOAD_PATH = "uploads/"
CKEDITOR_IMAGE_BACKEND = "pillow"
CKEDITOR_CONFIGS = {
    "default": {
        "toolbar_DefaultToolbarConfig": [
            {
                "name": "basicstyles",
                "items": [
                    "Bold",
                    "Italic",
                    "Underline",
                    "Strike",
                    "Subscript",
                    "Superscript",
                ],
            },
            {"name": "clipboard", "items": ["Cut", "Copy", "Undo", "Redo",],},
            {
                "name": "paragraph",
                "items": [
                    "NumberedList",
                    "BulletedList",
                    "Outdent",
                    "Indent",
                    "HorizontalRule",
                    "JustifyLeft",
                    "JustifyCenter",
                    "JustifyRight",
                    "JustifyBlock",
                    "Smiley",
                    "Blockquote",
                ],
            },
            {
                "name": "paste",
                "items": ["Paste", "PasteText", "CopyFormatting", "RemoveFormat",],
            },
            {
                "name": "style",
                "items": ["FontSize", "Format", "TextColor", "BGColor",],
            },
            {
                "name": "extra",
                "items": [
                    "Link",
                    "Unlink",
                    "Image",
                    "Table",
                    "CodeSnippet",
                    "Embed",
                    "Iframe",
                    "InsertSpecialCharacter",
                ],
            },
            {"name": "replace", "items": ["Find", "Replace", "SelectAll",],},
            {"name": "source", "items": ["Maximize", "Source",],},
        ],
        "title": False,
        "toolbar": "DefaultToolbarConfig",
        "linkShowTargetTab": False,
        "linkShowAdvancedTab": False,
        "height": "250px",
        "width": "auto",
        "forcePasteAsPlainText ": True,
        "pasteDataImages": False,
        "tabSpaces": 4,
        "extraPlugins": ",".join(["codesnippet", "image2", "embed", "tableresize",]),
    }
}
我已经介绍了Ckeditor的解决方案,但大多数解决方案要么完全禁用图像上传/粘贴,要么从工具栏中删除“图像”选项。 我不想那样。我只希望禁用图像复制粘贴,因此当用户使用工具栏中的图像选项上载时,链接将来自服务器机器

CKEDITOR_UPLOAD_PATH = "uploads/"
CKEDITOR_IMAGE_BACKEND = "pillow"
CKEDITOR_CONFIGS = {
    "default": {
        "toolbar_DefaultToolbarConfig": [
            {
                "name": "basicstyles",
                "items": [
                    "Bold",
                    "Italic",
                    "Underline",
                    "Strike",
                    "Subscript",
                    "Superscript",
                ],
            },
            {"name": "clipboard", "items": ["Cut", "Copy", "Undo", "Redo",],},
            {
                "name": "paragraph",
                "items": [
                    "NumberedList",
                    "BulletedList",
                    "Outdent",
                    "Indent",
                    "HorizontalRule",
                    "JustifyLeft",
                    "JustifyCenter",
                    "JustifyRight",
                    "JustifyBlock",
                    "Smiley",
                    "Blockquote",
                ],
            },
            {
                "name": "paste",
                "items": ["Paste", "PasteText", "CopyFormatting", "RemoveFormat",],
            },
            {
                "name": "style",
                "items": ["FontSize", "Format", "TextColor", "BGColor",],
            },
            {
                "name": "extra",
                "items": [
                    "Link",
                    "Unlink",
                    "Image",
                    "Table",
                    "CodeSnippet",
                    "Embed",
                    "Iframe",
                    "InsertSpecialCharacter",
                ],
            },
            {"name": "replace", "items": ["Find", "Replace", "SelectAll",],},
            {"name": "source", "items": ["Maximize", "Source",],},
        ],
        "title": False,
        "toolbar": "DefaultToolbarConfig",
        "linkShowTargetTab": False,
        "linkShowAdvancedTab": False,
        "height": "250px",
        "width": "auto",
        "forcePasteAsPlainText ": True,
        "pasteDataImages": False,
        "tabSpaces": 4,
        "extraPlugins": ",".join(["codesnippet", "image2", "embed", "tableresize",]),
    }
}
这是我的ckeditor配置设置

谢谢你的帮助