【发布时间】:2022-02-22 22:15:49
【问题描述】:
上传没有问题。但是当我查找文章进行编辑时,我看不到 youtube 视频
但实际上是 iframe 块。问题是我在管理面板上看不到它了
settings.py
CKEDITOR_CONFIGS = {
'default': {
'toolbar': 'CMS',
'width': '100%',
'toolbar_CMS': [
['Format', 'Styles', 'FontSize'],
[ 'Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript'],
['TextColor', 'BGColor'],
['Link', 'Unlink'],
['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'],
['Undo', 'Redo'],
['Copy', 'Paste', 'PasteText', 'PasteFromWord'],
['SelectAll', 'Find', 'Replace'],
['NumberedList', 'BulletedList'],
['Outdent', 'Indent'],
['Smiley', 'SpecialChar', 'Blockquote', 'HorizontalRule'],
['Table', 'Image', 'Youtube'],
['ShowBlocks', 'Source', 'About']
],
'extraPlugins': 'youtube',
'contentsCss': (
'/staticfiles/ckeditor/customization-files/style.css',
'/staticfiles/ckeditor/customization-files/bootstrap.css',
),
},
}
CKEDITOR_UPLOAD_PATH = 'content/ckeditor/'
models.py
class Article(models.Model):
title = models.CharField(max_length=200)
content = RichTextField(
extra_plugins=['youtube'],
null = False,
blank=False,
external_plugin_resources=[(
'youtube',
'/staticfiles/ckeditor/extra_plugins/youtube/',
'plugin.js',
)],
)
updated = models.DateField(auto_now=True)
created = models.DateField(auto_now_add=True)
Django 版本:3.2.3 django-ckeditor 版本:6.1.0
额外细节:当我点击“查看 HTML 源代码”并保存文章时,甚至当前视频也会从数据库中删除
【问题讨论】:
-
您是否以某种方式解决了这个问题?
-
@1D0BE 很遗憾没有
标签: django django-admin ckeditor django-ckeditor