要将TinyMCE包含在您的应用程序中,请在该项目的静态文件夹中包含tinymce文件夹。
之后,内部的静电/ JS创建一个JS文件把你的tinyMCE的的配置在我的情况tinymce_config.js
在里面cms_plugin.py您的应用程序包括此
class Media:
js = ('tinymce/tinymce.min.js', 'js/tinymce_config.js')
我tinymce_config.js是这样
// TinyMCE 4 configuration
// Modify the following code to customize TinyMCE
tinymce.init({
selector: "textarea",
// Only required plugins are included. However, you can add more as per your needs.
// Spellchecker plugin is excluded as it produces an error in version 4.x
plugins: [
"advlist autolink link image lists charmap preview hr",
"searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media",
"table contextmenu emoticons textcolor"
],
// Customize the toolbars below. You can also add new ones.
toolbar1: "bold italic underline | blockquote | bullist numlist| hr | formatselect fontselect fontsizeselect",
toolbar2: "undo redo | forecolor backcolor | link unlink | image media | alignleft aligncenter alignright alignjustify | outdent indent | searchreplace |code",
// toolbar3: " add buttons here ",
// Aditional options. Customize them as per your needs.
height: 350,
resize: "both",
image_advtab: true,
toolbar_items_size: "medium",
menubar: true,
// Example content CSS (should be your site CSS) for better typography
content_css : "/static/css/style.css"
// If your stylesheet is inside `static/css/` directory, just replace
// `style.css` with your stylesheet's name. You don't need to change the path.
});
我用这个link喜欢引用