阅读本文需要你对
Django
项目的创建和基本使用有一定的了解
一、快速使用
1、安装
在项目根目录下克隆项目后再安装:
git clone https://github.com/twz915/DjangoUeditor3.git
cd DjangoUeditor3
python setup.py install
不要用
pip install DjangoUeditor
命令安装,因为现在(2019.12.24)pipy
上的版本是基于python2
的,我们的Django2
用不了
2、settings.py 中添加APP:DjangoUeditor
INSTALLED_APPS = [
...
'DjangoUeditor',
]
3、根 urls.py 中配置路由
urlpatterns = [
...
path('ueditor/', include('DjangoUeditor.urls')),
]
4、在 Models.py 中应用
很简单的,直接把自己想要使用富文本编辑器的字段应用为UeditorField就可以了:
clas