Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cant upload photos #76

Open
Borisboky opened this issue Sep 20, 2019 · 1 comment
Open

Cant upload photos #76

Borisboky opened this issue Sep 20, 2019 · 1 comment

Comments

@Borisboky
Copy link

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

@tisdall
Copy link

tisdall commented Oct 3, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants