码迷,mamicode.com
首页 > 其他好文 > 详细

Django使用富文本编辑器

时间:2017-05-14 17:54:30      阅读:130      评论:0      收藏:0      [点我收藏+]

标签:model   目录   net   dia   config   demo   text   php   使用   

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使用富文本编辑器

标签:model   目录   net   dia   config   demo   text   php   使用   

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

踩
(0)
赞
(0)
   
举报
评论 一句话评论(0)
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!