Django-CKEditor Image Upload

余生颓废 提交于 2019-12-21 17:42:28

问题


I've currently installed Django-CKEditor and have my own custom toolbar.

I'm struggling to find how to enable image uploading. When clicking the Image button, I can only upload via URL. I know that, in the plugin, there are views to handle file browsing and uploading but I'm not sure how to activate or use these.

There is sparse documentation on the plugin so I am reaching out for your help!

https://github.com/shaunsephton/django-ckeditor


回答1:


In the current version (5) you can use RichTextUploadingField instead of RichTextField, which enables uploading and browse files button.

Previously you have to install django-uploader package.




回答2:


As I had mentioned in my question - Django CKEditor comes with a number of URLs to handle the viewing and browsing of images. The subsequent steps to activate this with your editor require you to add a filebrowserBrowseUrl when activating the editor and setting it to the appropriate /upload/ and /browse/ URLs.

See more here:

http://www.mixedwaves.com/2010/02/integrating-fckeditor-filemanager-in-ckeditor/



来源:https://stackoverflow.com/questions/17017553/django-ckeditor-image-upload

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!