【问题标题】:Django ckeditor upload imageDjango ckeditor 上传图片
【发布时间】:2020-06-07 10:20:50
【问题描述】:

我正在尝试使用 ckeditor 上传图片。看起来一切都是由文档设置的,但我在尝试上传图像时仍然遇到错误。我认为静态文件有问题。看起来 ckeditor 不知道在哪里上传文件,即使我已经提供了所有需要的参数:

MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')

CKEDITOR_UPLOAD_PATH = 'uploads/'
CKEDITOR_IMAGE_BACKEND = 'pillow'

我收到了这条消息:

[23/Feb/2020 20:17:47] "POST /ckeditor/upload/&responseType=json HTTP/1.1" 302 0

And here's what I get in browser. The red one is for "incorrect server response".

【问题讨论】:

    标签: python django ckeditor django-ckeditor


    【解决方案1】:

    我的项目中的“静态”文件夹位置似乎存在问题。我已经解决了我添加的问题

    CKEDITOR_STORAGE_BACKEND = 'django.core.files.storage.FileSystemStorage'
    

    到我的设置文件。不确定它是否适合您,但它肯定适合我,因为“FileSystemStorage”默认会查找“MEDIA_ROOT”设置。

    【讨论】:

      猜你喜欢
      • 2019-07-16
      • 2013-06-05
      • 2017-10-12
      • 2016-09-19
      • 2014-05-03
      • 2010-11-30
      • 2013-02-05
      • 2011-01-08
      • 1970-01-01
      相关资源
      最近更新 更多