在使用Amazon S3存储我的静态文件时,Django-TinyMCE中的弹出窗口(如创建表,插入图像和查看HTML)变得空白。 TinyMCE的所有其他功能均正常运行。
该网站本身托管在Heroku上。
它在Chrome控制台中引发以下错误:
Uncaught DOMException: Failed to set the 'domain' property on 'Document':
'<mysite>.org' is not a suffix of '<my-bucket>.s3.amazonaws.com'.
at https://<my-bucket>.s3.amazonaws.com/static1/assets/js/tiny_mce/tiny_mce_popup.js:3:17
charmap.js:11 Uncaught TypeError: Cannot read property 'requireLangPack'
of undefined
at charmap.js:11
tiny_mce.js:2 Blocked a frame with origin "https://www.<mysite>.org" from
accessing a frame with origin "https://<my-bucket>.s3.amazonaws.com". The
frame requesting access set "document.domain" to "<mysite>.org", but the
frame being accessed did not. Both must set "document.domain" to the same
value to allow access.
我设置了以下变量,但仍然存在相同的错误
在 settings.py
中TINYMCE_JS_URL = '%stiny_mce/tiny_mce.js' % MEDIA_URL
在 tiny_mce_pop.js , tiny_mce.js 和 init_tinymce.js
document.domain = 'mysite.org';
在 base.html
的头部<script type="text/javascript">document.domain = '<mysite>.org';</script>
任何帮助将不胜感激。谢谢!
编辑:更改了抛出的错误,不小心将错误的内容发布了