我有一个简单的博客项目,我想在 pythonanywhere 上展示。不幸的是我似乎无法解决 CKeditor 的问题。它在本地主机上工作,但在 pythonanywhere 上它显示错误并且仅显示标准文本编辑器窗口。
我确实在 Stackoverflow 上尝试过解决方案。我确实尝试运行collectstatics等。到目前为止没有任何帮助。
我发现有人说 Pythonanywhere 永远无法运行 CKeditor,但我没有找到更多相关信息。如果 CKeditor 不起作用,您知道还有其他可用的富文本编辑器吗?我需要一个带图片编辑功能的。
还有 here 是 Pythonanywhere.com 上的网页。
感谢您的任何建议。
如果需要,我将提供代码,我只是不知道到底哪一部分会导致这个问题。
编辑:错误文本:
Refused to apply style from 'https://esmessica.pythonanywhere.com/static/ckeditor/ckeditor.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
ckeditor-init.js:1
Failed to load resource: the server responded with a status of 404 (Not Found)
Refused to execute script from 'https://esmessica.pythonanywhere.com/static/ckeditor/ckeditor-init.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
ckeditor.js:1
Failed to load resource: the server responded with a status of 404 (Not Found)
Refused to execute script from 'https://esmessica.pythonanywhere.com/static/ckeditor/ckeditor/ckeditor.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
Refused to apply style from 'https://esmessica.pythonanywhere.com/static/ckeditor/ckeditor.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
您需要为 CKEditor 提供静态文件。请参阅https://help.pythonanywhere.com/pages/StaticFiles/