Ask Your Question
2

askbot_imageuploader is not working with tinymce

asked 2013-05-27 08:54:57 -0600

jqy3222089 gravatar image

updated 2013-05-28 06:34:27 -0600

Evgeny gravatar image

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.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2013-05-27 21:46:10 -0600

Evgeny gravatar image

updated 2013-05-28 06:33:46 -0600

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.

edit flag offensive delete link more

Comments

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

jqy3222089 gravatar imagejqy3222089 ( 2013-05-28 06:29:01 -0600 )edit

Got it now - updated my answer.

Evgeny gravatar imageEvgeny ( 2013-05-28 06:34:06 -0600 )edit
0

answered 2013-05-28 07:00:58 -0600

jqy3222089 gravatar image
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.

edit flag offensive delete link more

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 gravatar imagejqy3222089 ( 2013-05-28 07:37:45 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2013-05-27 08:54:57 -0600

Seen: 145 times

Last updated: May 28 '13