问题一:
我正在使用 Django-CKEditor,当我尝试在其中上传任何文件或图像时,它会显示 警报错误:“服务器响应不正确”,
当我检查终端时,它显示“GET /admin/login/?next=/ckeditor/upload/HTTP/1.1”
我不知道该怎么做才能完成这项工作!请在这里帮我...
问题 2:
当我在编辑器中复制粘贴 100 行文本时,它会增加其高度,而不是在其中提供任何滚动条,这是我正在使用的配置代码:
CKEDITOR_UPLOAD_PATH = '上传/' CKEDITOR_IMAGE_BACKEND = "枕头" CKEDITOR_CONFIGS = { '默认': { “身高”:“200”, “宽度”:1250, '工具栏_基本':[ ['来源','-','粗体','斜体'] ], 'toolbar_YourCustomToolbarConfig':[ {'name': 'document', 'items': ['Source']}, {'name': 'clipboard', 'items': ['Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo']}, '/', {'name': '基本风格', '项目':['粗体','斜体','下划线','罢工','下标','上标','-','RemoveFormat']}, {'name': '段落', 'items': ['NumberedList', 'BulletedList', '-', 'Blockquote', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', '-', 'BidiLtr', 'BidiRtl']}, {'name': 'links', 'items': ['Link', 'Unlink', 'Anchor']}, {'名称':'插入', 'items': ['Image', 'Table', 'SpecialChar']}, '/', {'name': 'styles', 'items': ['Styles', 'Format', 'Font', 'FontSize']}, {'name': 'colors', 'items': ['TextColor', 'BGColor']}, {'name': '工具', 'items': ['最大化']}, ], 'toolbar': 'YourCustomToolbarConfig', # 把选择的工具栏配置放在这里 # 'toolbarGroups': [{ 'name': 'document', 'groups': ['mode', 'document', 'doctools' ] }], # '身高': 291, # '宽度': '100%', # 'filebrowserWindowHeight': 725, # 'filebrowserWindowWidth': 940, # 'toolbarCanCollapse':是的, # 'mathJaxLib': '//cdn.mathjax.org/mathjax/2.2-latest/MathJax.js?config=TeX-AMS_HTML', 'tabSpaces': 4, '额外插件': ','.join([ 'uploadimage', # 上传图片功能 # 你的额外插件在这里 'div', '自动链接', '自动嵌入', '嵌入语义', '自动生长', # '开发工具', '小部件', 'lineutils', '剪贴板', '对话', '对话', '元素路径' ]), } }
网址.py
路径('ckeditor/',包括('ckeditor_uploader.urls')),
模型.py
从 django.db 导入模型 从 ckeditor_uploader.fields 导入 RichTextUploadingField 类表名(模型。模型): update_message = RichTextUploadingField(空白=真,空=真) 元类: db_table = "表名"
问题 3:
如何使编辑器的宽度根据屏幕自动调整。