Ckdeditor自动将Backslah添加到图像URL的末尾

时间:2019-04-07 11:04:05

标签: django django-ckeditor

我对ckeditor django有问题,它会在图像源末尾自动添加\。 这是我来自api请求的结果

<img alt=\"\" src=\"/media/uploads/2019/04/07/pinterest-texttext-quote-hd-wallpaper-inspirational-quote-typography-positive-wallpaperquotes-motivational-feelings.jpg\" />

能帮我找到问题吗?

这是我的网址

urlpatterns = [

    path('api/', include(router.urls)),
    path('api-token-auth/', obtain_auth_token, name='api_token_auth'),
    path('ˆckeditor/', include('ckeditor_uploader.urls')),
] + static(settings.MEDIA_URL, document_root=settings.STATIC_ROOT)

这是设置。py



# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/2.1/howto/static-files/
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
MEDIA_URL = '/media/'
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
STATIC_URL = '/static/'

CKEDITOR_UPLOAD_PATH = 'uploads'
CKEDITOR_RESTRICT_BY_USER = True

CKEDITOR_CONFIGS = {
    'default': {
        'toolbar': 'Advanced',
        'width': 758,
        'height': 300,
    },
}

0 个答案:

没有答案