[Fixed]-Django-tinymce not loading javascript

1👍

As it turns out, the error was in settings.py. The tinymce location needs to be set like this:

TINYMCE_JS_ROOT = "articles/build/lib/node_modules/tinymce"
TINYMCE_JS_URL = os.path.join(TINYMCE_JS_ROOT, "tinymce.js")
👤Flobin

0👍

From django-tinymce docs:

In your own templates containing a TinyMCE widget you must add the following to the HTML HEAD section (assuming you named your form ‘form’):

<head>
...
{{ form.media }}
</head>

Try {{ articleform.media }}

👤4140tm

0👍

Is jQuery available? I added adding your ArticleSubmitView into my working tinymce project, without your tinymce config, and I got an error that jQuery was not defined. When I added a script tag for jQuery above your {% block extra_head_stuff %} tag in base.html, the tinymce editor showed up.

Note that this is with the following, default settings:

TINYMCE_SPELLCHECKER = False
TINYMCE_COMPRESSOR = True
TINYMCE_DEFAULT_CONFIG = {
    'theme': "advanced",
    'theme_advanced_buttons3_add': "|,spellchecker",
}

Using your settings, I get an error that tinymce.min.js is not found (though this may be due to me not copying over your static setup).

Leave a comment