不允许位于 https://lyrics-chords.herokuapp.com/ 的页面显示来自 http://localhost:8000/auth/user 的不安全内容

The page at https://lyrics-chords.herokuapp.com/ was not allowed to display insecure content from 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: set SSL certificates on Free Plan?)。有解决办法吗?

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