今天在處理官網服務器時候集成DjangoUeditor報錯。在Xadmin後臺,打開帶有DjangoUeditor的詳情頁時,報錯。
return mark_safe(render_to_string('ueditor.html', context))
首先安裝,DjangoUeditor。
先到github上下載,DjangoUeditor3版本:https://github.com/twz915/DjangoUeditor3
下載完成以後,放到服務器上解壓:
進入DjangoUeditor3-master
使用python setup.py install 命令進行安裝。
安裝過程,會將DjangoUeditor 安裝在服務器的python目錄下,我這裏是
/usr/local/lib/python3.5/dist-packages/DjangoUeditor
然後,將DjangoUeditor的文件夾中的,templates目錄,拷貝到/usr/local/lib/python3.5/dist-packages/DjangoUeditor中。
然後重啓服務器。OK