问题
I am using django-ckeditor. And now I need to add one new plugin. This I have read that, I should download and extract it into "plugins" folder :
Extract the contents of the file into the "plugins" folder of CKEditor.
But I have not any "plugins" folder in my project. There is one, but it is located in Lib\site-packages\ckeditor\static\ckeditor\ckeditor\plugin
.
So, if I add it there - it will be unavailable when I will deploy it in production or on another computer...
And what should I do?
回答1:
From this thread
static files go into static files directory. If you put plugin ins a ckeditor/ckeditor/plugins subfolder it will work. Collectstatic will merge all files and folders and you will get typical ckeditor setup
So, put the plugin code in the static
folder of your project, in static/ckeditor/ckeditor/plugins
and it should work.
回答2:
Thank for your question. I just add html5audio
plugin into djnago-ckeditor
. Full path is:
- Download plugin from the official repo.
- Unzip
html5audio
directory into/path/to/your/project/static/ckeditor/ckeditor/plugins/
or/python/libs/ckeditor/static/ckeditor/ckeditor/plugins/
with all it's content. - Add
html5audio
plugin into yoursettings.py
near otherCKEDITOR
variables:
CKEDITOR_CONFIGS = {
'default': {
'toolbar': 'full',
'extraPlugins': ','.join(
[
'html5audio',
]
),
},
}
4. Reload page with ckeditor widget :).
来源:https://stackoverflow.com/questions/34541431/how-can-i-install-plugin-into-ckeditor-django