jazzband / django-tinymce

TinyMCE integration for Django
http://django-tinymce.readthedocs.org/
MIT License
1.28k stars 317 forks source link

The TinyMCE javascript code is not being loaded in the admin #469

Closed eduardo-boutiquenumerique closed 3 months ago

eduardo-boutiquenumerique commented 4 months ago

I'm using Django 3.2 and django-tinymce 4.0.0.

"tinymce" is included in the installed apps and I have added the line path('tinymce/', include('tinymce.urls')), to my urls.py file.

The only "non standard" thing I have is that I have created a subclass of admin.AdminSite.

I don't know when this stopped working, but it was working on Django 1.11.29 (I know, quite old) with django-tinymce 2.6.0.

When I look at the html source code of an admin page supposed to have tinymce widgets, the class "tinymce" is present in the texarea but there is no call to the js. Checking in chrome dev tools -> network, I can confirm that no js is being requested.

What could be the issue here ?

Pantzan commented 4 months ago

In my setups, I've downloaded the tinymce source code and in Django settings I set the js file so django-tinymce can read it. TINYMCE_JS_URL = os.path.join(settings.STATIC_URL, "tinymce/tinymce.min.js")

Another reason I can think of making the js files not loading is incorrect usage. Do you load the tinymce widget in TextFields and CharFields?

body = TextField(
       required=False,
       widget=TinyMCE(),
   )
claudep commented 3 months ago

I just tested in one of my projects and the TinyMCE widget was loading fine. Something should be wrong in your setup. I'll close the ticket, but if you give us some sample code, maybe someone can continue to give you help.