在TinyMce django中添加插件(电源粘贴)

嗨,我想在我的Django应用程序的TinyMce中添加粘贴插件。 这是setting.py配置。

   TINYMCE_DEFAULT_CONFIG = {
"toolbar": 'mobileequationeditor','height': 360,'width': 1120,'cleanup_on_startup': True,'custom_undo_redo_levels': 20,'selector': 'textarea','theme': 'modern','plugins':"powerpaste",'toolbar1': '''
       fullscreen preview bold italic underline | fontselect,fontsizeselect  | forecolor backcolor | alignleft alignright |
       aligncenter alignjustify | indent outdent | bullist numlist table |
       | link image media | codesample | MathJax |
       ''','toolbar2': '''
       visualblocks visualchars |
       charmap hr pagebreak nonbreaking anchor |  code |
       ''','contextmenu': 'formats | link image','menubar': True,'statusbar': True,}

当我在admin中打开模型时,出现错误提示

Failed to load plugin: powerpaste from url https://website.com/static/tinymce/js/tinymce/plugins/powerpaste/plugin.min.js

我尝试了collectstatic,但是没有收集到新的static。 在哪里可以获取plugin.min.js以及应该放在哪里。

在setting.py中,我的静态文件配置为

STATIC_ROOT = os.path.join(BASE_DIR,'staticfiles')
STATIC_URL = '/static/'

我正在生产中运行这些。

有什么解决方案? 问题是我想将图像从Word文件直接复制到RichTextField中。

able_lq 回答:在TinyMce django中添加插件(电源粘贴)

PowerPaste是一个商业插件,因此不属于可免费访问的TinyMCE软件包。您需要购买PowerPaste才能访问该插件,此时可以下载该插件并将其添加到您的项目中。

如果您选择执行此操作,我建议将PowerPaste代码与其余的TinyMCE代码放在单独的位置,并使用external_plugins通过TinyMCE配置加载它。这样一来,您就可以更新TinyMCE编辑器的核心代码,而不会意外删除PowerPaste代码。

本文链接:https://www.f2er.com/3103317.html

大家都在问