summernote / django-summernote

Simply integrate Summernote editor with Django project.
MIT License
1.03k stars 225 forks source link

Problems using "iframe": False with the admin widget #443

Open salomvary opened 3 years ago

salomvary commented 3 years ago

First of all, thanks for making an easy Django+Summernote integration happen!

I've spent several hours today trying to set up the Summernote widget on the admin site without using iframes. This was caused by a series of issues:

There might be an easy way to get all this working but it's not obvious from the documentation/source code.

I'm using the following settings:

SUMMERNOTE_CONFIG = {
    "iframe": False,
    "jquery": "summernoteJQuery",
}

SUMMERNOTE_THEME = "lite"

...and admin/base looks like this:

{% extends "admin/base.html" %}
{% load static %}

{% block extrahead %}
  <script src="//code.jquery.com/jquery-3.3.1.min.js"></script>
  <script src="{% static "summernote/summernote-lite.min.js" %}"></script>
  <script>window.summernoteJQuery = jQuery.noConflict(true);</script>
{% endblock %}

But all this only works with my hacky fork: https://github.com/salomvary/django-summernote

salomvary commented 2 years ago

@salomvary Why does it only work with your fork?

Because of the reasons mentioned in the description of this issue above?

calicojack commented 2 years ago

@salomvary I apologize, I am totally blanking on this one. Is this something I brought up?

upokusaev commented 2 years ago

@salomvary Hello. Thanks for your fork, summernote now works without an iframe. But there is one problem: photos are not loaded from the file system. Do you know what the problem might be?

salomvary commented 2 years ago

@salomvary Hello. Thanks for your fork, summernote now works without an iframe. But there is one problem: photos are not loaded from the file system. Do you know what the problem might be?

No, unfortunately I don't know, I don't use the widget with photos in any way.

salomvary commented 11 months ago

I've found another issue where dynamically added Summernote widgets as part of form inlines do not properly get initialized. Workaround here: https://github.com/salomvary/django-summernote/commit/ddd27373813001b061f328b1e9d218e51b0b8881