Home:ALL Converter>can not upload image using Django-CKEditor (Error 400)

can not upload image using Django-CKEditor (Error 400)

Ask Time:2021-10-17T04:38:22         Author:Teq Teq

Json Formatter

when I want to upload an image in CKEditor, it gives me the Error "HTTP error occurred during file upload (error status: 400)."

please check the image below

Image

inside urls.py

from django.contrib import admin

from django.urls import path,include
from django.conf import settings
from django.conf.urls import url
from django.conf.urls.i18n import i18n_patterns
from django.conf.urls.static import static


urlpatterns = i18n_patterns(
    ....
    path('ckeditor/',include('ckeditor_uploader.urls')),
    ....
    )



if settings.DEBUG:
    urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

inside settings.py ---> for CKEDITOR

INSTALLED_APPS = [
    ...,
    'ckeditor',
    'ckeditor_uploader',
    ...,
    
    
]

#Ckeditor


CKEDITOR_IMAGE_BACKEND = "pillow"

CKEDITOR_UPLOAD_PATH="uploads/"


CKEDITOR_CONFIGS={

     'myconfig':{
        'toolbar':"Custom",
    'toolbar_Custom':[

    ['Styles','Format','Font','FontSize','BidiLtr','BidiRtl'],
    ['JustifyLeft','JustifyCenter','JustifyRight','NumberedList', 'BulletedList','Bold','Italic','Underline','Strike','Undo','Redo'],
    ['Link','Unlink','Anchor'],
    ['TextColor','BGColor'],
    ['Smilely','SpecialChar'],
    ['Source','Scayt','Maximize'],
    ['Table','Templates','Iframe','Image'],
    ],
    'height': 100,
    },

}

in models.py

 content = RichTextUploadingField(config_name='myconfig')

would you please help me with that

Author:Teq Teq,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/69599389/can-not-upload-image-using-django-ckeditor-error-400
yy