flask-ckeditor | secure random filename custom upload path simple to use | File Upload library
kandi X-RAY | flask-ckeditor Summary
kandi X-RAY | flask-ckeditor Summary
flask:fire:ckeditor
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Upload CKEditor
- Upload a file
- Generate random filename
flask-ckeditor Key Features
flask-ckeditor Examples and Code Snippets
Community Discussions
Trending Discussions on flask-ckeditor
QUESTION
I'm stuck with following problem while creating my Flask based blog.
Firstly, I used CKeditor 4 but than upgraded to 5 version.
I can't understand how to handle image upload on server side now, with adapters etc. As for 4 version, I used flask-ckeditor extension and Flask documentation to handle image uploading.
I didn't find any examples for this combination. I understand that I lack knowledge and I'm looking for advice in which direction may I advance and which concepts should I know to approach such subject.
Thanks in advance.
My takes on this so far:
According to https://ckeditor.com/docs/ckeditor5/latest/features/image-upload/simple-upload-adapter.html
(official guide on simplest adapters).
config.simpleUpload.uploadUrl
should be like /upload
route that was used in cke4. Object with URL property needed by cke5 is cke4's upload_successful
which was returned by /upload route.
ANSWER
Answered 2022-Jan-10 at 09:20So I figured it out.
As for cke 4:
/upload
route handled uploading process by returning upload_successful()
from flask-ckeditor extension.
upload_successful()
itself is a jsonify-ing function, which in turn modify arguments to fit json format.
As for cke 5: There were some things aside upload handling, which caused problems.
Plugin used: "Simple upload adapter"
I integrated cke5 by downloading from Online-builder and then reinstalling and rebuilding it by myself. (for this on Ubuntu 20.04 I installed
nodejs
andnpm
bysudo apt install
.) Plugin is installed by executing from/static/ckeditor
folder:npm install
npm install --save @ckeditor/ckeditor5-upload
npm run build
(need to wait here for a little)Different adapters may conflict and not allow Editor to load, so I removed CKFinder adapter from
src/ckeditor.js
inimport
and.builtinPlugins
sections, replacing them byimport SimpleUploadAdapter from '@ckeditor/ckeditor5-upload/src/adapters/simpleuploadadapter.js';
andSimpleUploadAdapter
correspondingly.
.html
, where CKEditor instance is created.body
here is name offlask_wtf
text-field:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install flask-ckeditor
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page