简体   繁体   English

将 div 的内容保存在字符域 model Django

[英]Saving the content of div in a charfield model Django

I'm using the TinyMCE inline editor and it changes the conetents of a particular div.我正在使用 TinyMCE 内联编辑器,它更改了特定 div 的内容。 I am looking for a way to store those changes in a Django model once a button is pressed.一旦按下按钮,我正在寻找一种将这些更改存储在 Django model 中的方法。

Once you try a 'ckeditor' it's a simmular like tinyMCE and it's easy to use.一旦您尝试使用“ckeditor”,它就像 tinyMCE 一样,并且易于使用。

just install PIP INSTALL ckeditor只需安装PIP 安装 ckeditor

setting.py ---> installed app in 'ckeditor' setting.py ---> 在 'ckeditor' 中安装的应用程序

models.py ---> from ckeditor.fields import RichTextField models.py ---> 从 ckeditor.fields 导入 RichTextField

content = RichTextField()内容 = RichTextField()

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM