Django文本编辑器配置:
pip install django-ckeditor
修改设置文件settings.py:
# ckeditor CKEDITOR_IMAGE_BACKEND = 'PIL' MEDIA_URL = '/media/' MEDIA_ROOT = os.path.join(BASE_DIR,'media/') CKEDITOR_UPLOAD_PATH = 'upload/'
添加:
'ckeditor', 'ckeditor_uploader',
配置url:
在urlpatterns后面加上:
urlpatterns = []+ static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
参考资料:https://blog.csdn.net/qq_27437781/article/details/80852978