1

I'm trying to use django-tinymce to edit fields in django admin.

I've the app installed in my virtualenv (django-tinymce==1.5.1b4). It's listed in my installed apps -

INSTALLED_APPS = (
    #...

    'tinymce',

    #...
)

My settings includes the following

TINYMCE_DEFAULT_CONFIG = {
'theme': "advanced",
'theme_advanced_toolbar_location': "top",
'theme_advanced_buttons1': "bold,italic,underline,separator,"
    "bullist,separator,outdent,indent,separator,undo,redo",
'theme_advanced_buttons2': "",
'theme_advanced_buttons3': "",
}

TINYMCE_SPELLCHECKER = True
TINYMCE_COMPRESSOR = True

And I've got the files available at /MEDIA_ROOT/js/tiny_mce (the default).

My models look like -

from tinymce import models as tinymce_models

class MyModel(models.Model)

    post = tinymce_models.HTMLField()

When I go to the model admin page, the field appears as a normal text field and my browser tells me there's an error on the inline js script for the field. It says it doesn't recognise the variable tinyMCE. It doesn't look like the page is even trying to load the js file (I'm getting no 404's - I can't see any sign of anything being loaded).

I'm not sure what I'm missing..

Aidan Ewen
  • 13,049
  • 8
  • 63
  • 88

2 Answers2

1
  1. Have You, Sir, done python manage.py collectstatic ?
  2. What value variable in settings.py is in TINYMCE_JS_ROOT and TINYMCE_JS_URL
  3. If variable TINYMCE_JS_URL is not set check if You, Sir, have file at /MEDIA_ROOT/js/tiny_mce/tiny_mce.js. If not, try to copy manually from django-tinymce's egg.
WBAR
  • 4,924
  • 7
  • 47
  • 81
  • Thanks for the suggestions. 1 - yup done it. 2 - I haven't set them. 3 - yes it's available. It looks like it may have been a problem with the django_tinymce app itself. – Aidan Ewen Jan 09 '13 at 16:44
  • I had problems under Windows OS so I have been using latest stable version 1.5 – WBAR Jan 10 '13 at 09:19
1

OK, looks like it might have been a bug in the django_tinymce code. I've reverted to 1.5.1b2 and everything works as expected. Guess I should look into filing a bug report.

Aidan Ewen
  • 13,049
  • 8
  • 63
  • 88
  • Why my comment about reverting version You, Sir, used as Your own solution ? – WBAR Jan 15 '13 at 15:40
  • @WBAR I'd already posted my solution before you added your comment!?! Read my PRECEDING comment. I'm not beneath asking people for reputation, but that seems to be pushing it. If someone else came along with the same problem, they still wouldn't find thier solution in your answer. Or even your comment - I doubt 1.5b4 is officially an 'unstable' (beta / dev) version. Saying that, I do appreciate you taking the time to try and help me. – Aidan Ewen Feb 13 '13 at 05:30