我安装了 djnago-ckeditor 并按照安装指南进行操作。用于RichTextUpload()
我从ckeditor_uploader
. 当我尝试上传图片时,它是说
图像源 URL 丢失'。
我正在使用python,django最新版本
基本设置.py
INSTALLED_APPS=[
......
'ckeditor',
'ckeditor_uploader',
]
CKEDITOR_UPLOAD_PATH = os.path.join(BASE_DIR, MEDIA_ROOT, 'ckeditor_media')
CKEDITOR_JQUERY_URL = '//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js'
CKEDITOR_IMAGE_BACKEND = 'pillow'
CKEDITOR_CONFIGS = {
'default': {
'toolbar': 'full',
'height': 300,
'width': '100%',
},
}
网址.py
path('ckeditor/', include('ckeditor_uploader.urls')),
模型.py
from ckeditor_uploader.fields import RichTextUploadingField
...Model
about = RichTextUploadingField()