要將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喜歡引用