Search code examples
djangosummernotedjango-ckeditor

Django - WYSIWYG Editor not displaying in template


I am now using django ckeditor as a WYSIWYG editor for adding product information, previously I was using Summernote, but after moving to production the widget would not display in my template (at all, just a big white space) so I decided to try ckeditor.

However with django CKEditor all I see is a normal textarea, rather than the WYSIWYG editor.

The source code from the template is as follows:

<div class="col-sm-2"> Description:</div><div class="col-sm-10"><div class="django-ckeditor-widget" data-field-id="id_description" style="display: inline-block;">
<textarea cols="40" id="id_description" name="description" rows="10" data-processed="0" data-config='{"toolbar_Basic": [["Source", "-", "Bold", "Italic"]], "language": "en-us", "height": 291, "width": 835, "toolbar": "Full", "skin": "moono", "toolbar_Full": [["Styles", "Format", "Bold", "Italic", "Underline", "Strike", "SpellChecker", "Undo", "Redo"], ["Link", "Unlink", "Anchor"], ["Image", "Flash", "Table", "HorizontalRule"], ["TextColor", "BGColor"], ["Smiley", "SpecialChar"], ["Source"]], "filebrowserWindowWidth": 940, "filebrowserWindowHeight": 725}' data-external-plugin-resources='[]' data-id="id_description" data-type="ckeditortype"></textarea>

My installation process was very simple: install django-ckeditor, (jquery already), add to installed apps, collectstatic, change the widget in my modelform, refresh server.

I am sure there is a simple thing I am missing here but I have no idea what it could be!

Any ideas?


Solution

  • You didn't mention if this is in admin or custom view.

    If this is in a custom view check that both the widget .js file and jQuery are linked correctly in your page.

    If it's in admin you probably don't have jQuery linked there and should add this to your settings.py: CKEDITOR_JQUERY_URL = '//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js

    If both do not help share what errors your JS console gives you