First time here? Check out the FAQ!
2

askbot_imageuploader is not working with tinymce

I have changed the editor into tinymce, but askbot_imageuploader and askbot_attachment are not working correctly.

BTW I did not changed the configuration of django-tinymce.

jqy3222089's avatar
17
jqy3222089
asked 2013-05-27 08:54:57 -0600
Evgeny's avatar
13.2k
Evgeny
updated 2013-05-28 06:34:27 -0600
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

2 Answers

0

Make sure that DEBUG=False in the settings.py. There is a weird feature in the tinymce app that it won't load custom extensions with the js compressor for tinymce enabled, so those two button show only in the production mode.

I've checked this on the dev branch - works for me. If the buttons show, but the images don't insert, it could be that your MEDIA_ROOT is not server-writeable.

Evgeny's avatar
13.2k
Evgeny
answered 2013-05-27 21:46:10 -0600, updated 2013-05-28 06:33:46 -0600
edit flag offensive 0 remove flag delete link

Comments

Those two buttons didn't show in the tinymce tool bar.

jqy3222089's avatar jqy3222089 (2013-05-28 06:29:01 -0600) edit

Got it now - updated my answer.

Evgeny's avatar Evgeny (2013-05-28 06:34:06 -0600) edit
add a comment see more comments
0
def get_file_contents(filename):
    base_path = tinymce.settings.JS_ROOT
    if settings.DEBUG and settings.STATIC_ROOT:
        from django.contrib.staticfiles import finders
        base_path = finders.find('tiny_mce')

    try:
        f = open(os.path.join(base_path, filename))
        try:
            return f.read()
        finally:
            f.close()
    except IOError:
        return ""

this is one of the django-tinymce files, so if you are in debug mode, it will use the root of django-tinymce to load the js files.

jqy3222089's avatar
17
jqy3222089
answered 2013-05-28 07:00:58 -0600
edit flag offensive 0 remove flag delete link

Comments

@Evgeny and also the TINYMCE_JS_ROOT needs to be adjusted in windows TINYMCE_JS_ROOT = os.path.join(STATIC_ROOT, 'default/media/js/tinymce/').replace('\','/')

jqy3222089's avatar jqy3222089 (2013-05-28 07:37:45 -0600) edit
add a comment see more comments