我刚刚完成了 Django-React 应用程序的创建,并将更改推送到 Heroku。前端(JS和CSS)在网站上显示没有问题,但请求后端导致以下错误:
[blocked] The page at https://lyrics-chords.herokuapp.com/ was not allowed to display insecure content from http://localhost:8000/auth/user
我查阅了互联网,但似乎没有人收到相同的错误消息。咨询 friend ,似乎我必须 https 保护我的后端,并进一步研究该主题,似乎没有免费的方法来上传 SSL/TSL 证书(引用: heroku: set SSL certificates on Free Plan? )。有没有办法解决这个问题?
最佳答案
我真傻,真的。结果,localhost:8000
指的是用户的计算机。 https://lyrics-chords.herokuapp.com/
是后端和前端的服务器,因此更新后端 URL 调用就足够了。
关于django - https ://lyrics-chords. herokuapp.com/的页面不允许显示来自 http://localhost:8000/auth/user 的不安全内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68203093/