首页 > 解决方案 > https://lyrics-chords.herokuapp.com/ 的页面不允许显示来自 http://localhost:8000/auth/user 的不安全内容

问题描述

我刚刚创建了一个 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

我已经咨询了 Internet,但似乎没有人收到相同的错误消息。咨询朋友,好像我必须https保护我的后端,并且进一步研究这个主题,似乎没有免费的方式来上传SSL / TSL证书(参考:heroku:在Free Plan上设置SSL证书?) . 有针对这个的解决方法吗?

标签: djangohttpherokuhttps

解决方案


傻我,真的。原来,localhost:8000指的是用户的电脑。https://lyrics-chords.herokuapp.com/是后端和前端的服务器,因此更新后端 URL 调用就足够了。


推荐阅读