First time here? Check out the FAQ!

Revision history  [back]

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.