首页 > 其他 > 详细

Django使用富文本编辑器

时间:2017-05-14 17:31:06      阅读:364      评论:0      收藏:0      [点我收藏+]

1.下载kindeditor
  网址:http://kindeditor.net/demo.php
2.解压到项目中
  地址:\static\js\kindeditor-4.1.10
3.删除没用的文件
  例如:example,php,asp等
4.在需要使用富文本编辑器的model中定义meta类:

class Media:
        js = (
            /static/js/kindeditor-4.1.10/kindeditor-min.js,
            /static/js/kindeditor-4.1.10/lang/zh_CN.js,
            /static/js/kindeditor-4.1.10/config.js,
        )

5.在kindeditor-4.1.10目录中定义config.js文件:

KindEditor.ready(function(K) {
                K.create(textarea[name=需要使用富文本的字段名],{
                    width:800px,
                    height:200px,
                });
        });

 

Django使用富文本编辑器

原文:http://www.cnblogs.com/413xiaol/p/6852988.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!