flask-ckeditor icon indicating copy to clipboard operation
flask-ckeditor copied to clipboard

Where does the CKEditor Bundle go?

Open skwzrd opened this issue 1 year ago • 1 comments

Where should the CKEditor standard bundle go? The only way I've gotten this Flask extension to work (without inserting my own <script>s and <link>s into HTML) is by editing the source code to

class CKEditor(object):
    def __init__(self, app=None):
        if app is not None:
            self.init_app(app)

    def init_app(self, app):
        blueprint = Blueprint(
            'ckeditor',
            __name__,
            static_folder='static',
            # static_url_path='/ckeditor' + app.static_url_path # removing this line
        )

and placing the standard bundle in /static/. i.e. /static/standard/ckeditor.js, static/standard/plugins/, etc.

I've tried placing the bundle in virtually every folder. What's really weird is, despite the bundle being present in a certain directory, the request for a resource will 404.

skwzrd avatar Jan 06 '24 20:01 skwzrd

Not sure this helps you but maybe it will help someone else but if you want to bundle your own ckeditor by adding more plugins then you need to load the ckeditor from static like this:

{{ ckeditor.load(custom_url=url_for('static', filename='ckeditor/ckeditor.js')) }}

but you also need to pack the assets yourself if you download the unoptimized version.

baron avatar Jan 12 '24 00:01 baron

Fixed in the 1.0.0 version, please try to update it with:

pip install -U flask-ckeditor

Thanks!

greyli avatar Jul 04 '24 15:07 greyli