使用Froala edi在Django后端添加照片

2024-05-15 01:53:41 发布

您现在位置:Python中文网/ 问答频道 /正文

我尝试在Django后端使用Froala编辑器,但我无法添加照片

在根目录的my url.py中,我添加了如下url:

urlpatterns = patterns('',
                       url(r'^$', include('main.urls')),
                       url(r'^froala_editor/', include('froala_editor.urls'))
                       ) + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)

setings.py中,我有如下:

STATIC_URL = '/assets/'
STATIC_ROOT = "/var/www/frontend/website/public/"
FRAOLA_EDITOR_THIRD_PARTY = ('image_aviary', 'spell_checker')
FROALA_UPLOAD_PATH = "assets/froala_editor/images"

models.py中,我有如下字段:

content = FroalaField(theme='dark')

但是,当我尝试在django admin中添加照片时,出现如下错误:

“无法从传递的链接加载图像”

enter image description here


Tags: djangopyurlsettingsincludestaticroot编辑器

热门问题