Django Wysiwyg and images (Summernote or Froala)

268 views
Skip to first unread message

David Mutton

unread,
Feb 3, 2015, 5:04:30 PM2/3/15
to django...@googlegroups.com
Hi,
I've been trying to integrate a WYSIWYG editor into my Django project. I first started with Summernote and I had no issue integrating the it into admin or a form. I followed the instructions on their github and everything works great except image uploading and inserting. The file is uploading (I can see it in the filesystem) but it does not show up in the editor or in the resulting html.

I thought it was just Summernote and so I switched to Froala but I'm getting the exact same behavior. Is there something I'm missing with image upload inside a wysiwyg?


Dave

Sakis Brouzioutis

unread,
Mar 1, 2015, 6:33:40 PM3/1/15
to django...@googlegroups.com
Hi Dave,

I encounter the same problem. Did you find any solution?

I really don't know what is going wrong and the image does not appear.

Sakis

David Mutton

unread,
Mar 2, 2015, 2:48:41 AM3/2/15
to django...@googlegroups.com
Hi Sakis,
I did manage to solve this using froala ( https://github.com/froala/django-froala-editor)with a two step process.
1) First I set up my environment with gunicorn as the application server and nginx serving up /static/* and /media/*

2) When an image is dragged into froala a http request is made to a django view which uploads the image and returns the path of the image in the form {link:'path/to/file.png''} by viewing the console (ctrl+shift+j in chrome)while dragging images into froala I saw that the wrong path was being returned (a leading / was missing) I edited froala's view.py to return the correct path. While I was there I also edited it to save file uploads to the correct location.

--
You received this message because you are subscribed to a topic in the Google Groups "Django users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-users/jKvMnVPnMjM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/a0eb7cff-6423-4f86-b4ac-fea9604e6604%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages