ckeditor Youtube plugin.js returns 添加 extraPlugins 时不显示 404 错误?

ckeditor Youtube plugin.js returns 404 error on not display when extraPlugins add?

youtube 插件安装位置是 /static/ckeditor/ckeditor/plugins/youtube/youtube/ 当我 运行 配置 'extraPlugins': ','.join(['youtube']), if returns "GET /static/ckeditor/ckeditor/plugins/youtube/plugin.js?t=JB9C HTTP/1.1" 404 1863 错误并且不显示 ckeditor 时我得到这个错误 models.py

from ckeditor_uploader.fields import RichTextUploadingField
from django.db import models


class Article(models.Model):
     title = models.CharField(max_length=100)
     content = RichTextUploadingField(blank=True)

    def __str__(self):
        return self.title

settings.py

STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
STATICFILES_DIRS = (
    os.path.join(BASE_DIR, 'assets'),
)

CKEDITOR_UPLOAD_PATH = 'article/'
CKEDITOR_IMAGE_BACKEND = "pillow"
CKEDITOR_CONFIGS = {
    'default': {
        'width': 'auto',
        'extraPlugins': ','.join(['youtube']), # return "GET /static/ckeditor/ckeditor/plugins/youtube/plugin.js?t=JB9C HTTP/1.1" 404 1863 error and ckeditor is not display
        'toolbar': [
            ['Bold', 'Italic', 'Underline'],
            ['Font', 'FontSize', 'TextColor', 'BGColor'],
            ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-',
                'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'],
            ['Link', 'Unlink'],
            ['RemoveFormat', 'Source', 'Image', 'Youtube']
        ],
    }
}

config.js

CKEDITOR.editorConfig = function (config) {

    config.extraPlugins = 'youtube';
};

插件的相对路径必须是: /static/ckeditor/ckeditor/plugins/youtube/

你用的是 /static/ckeditor/ckeditor/plugins/youtube/youtube/

删除多余的“youtube”目录,其余代码没问题。