django-froala-editor icon indicating copy to clipboard operation
django-froala-editor copied to clipboard

Cant upload photos

Open Borisboky opened this issue 6 years ago • 1 comments

I'm trying to use Froala Editor in Django backend but I cant add photos.

In my urls.py in root directory I've added url as follow:

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

In setings.py the I have as follows:

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"

In models.py I have field as follow:

content = FroalaField(theme='dark')

But when I try to add a photo in django admin I get an error as follows:

"IMAGE CANNOT BE LOADED FROM THE PASSED LINK"

enter image description here

Borisboky avatar Sep 20 '19 12:09 Borisboky

uploaded files go into MEDIA_ROOT and MEDIA_URL is used to create the url... Have you defined those?

You may want to use the browser's developer console to view what JSON is returned by the upload view and see what the "passed link" says.

tisdall avatar Oct 03 '19 19:10 tisdall