python安裝djangp-ueditor后需要注意的事項

python

安裝好django-ueditor這個擴展包之后,我們還需要修改一些配置文件,我們才能正常使用ueditor,下面簡單介紹下需要修改的內容。

1.修改settings.py配置文件

QINIU_BUCKET = ''

MEIDA_ROOT = os.path.join(BASE_DIR,"media")

MEDIA_URL = '/media/'

2.? 安裝缺失的包

? ? pip install shortuuid

? ?pip install qiniu

3.模型中引入ueditor

? from ueditor import UEditorField


? content = UEditorField("內容",default="")

4. 修改ueditor源碼包中的widgets.py文件

將grp.jQuery 替換成 django.jQuery

5.修改路由配置

from web.settings import MEDIA_ROOT

from django.views.static import serve

re_path(r'^ueditor/',include('ueditor.urls')),

re_path(r'^media/(?P<path>.*)$', serve, {'document_root': MEDIA_ROOT})



django-ueditor
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容