django - 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证书?) . 有针对这个的解决方法吗?
解决方案
傻我,真的。原来,localhost:8000
指的是用户的电脑。https://lyrics-chords.herokuapp.com/
是后端和前端的服务器,因此更新后端 URL 调用就足够了。
推荐阅读
- video - FFmpeg - 具有不同旋转的 Concat 视频
- c# - 将“纯”Python 与 .Net 集成
- swift - 如何使 NSMutableAttributedString 对链接起作用?
- java - 无法在 Spring Data Repository 中创建自定义查询方法
- sql-server - 在计划作业中运行 SSIS 包
- c++ - windows和Linux中字体渲染的区别,Qt Cpp
- ios - Xcode 10 上的 Spotify 安装问题
- android - Firebase functions.https.onCall 有效但返回 null
- node.js - 使用装饰器注入类时测试失败
- jquery - 背景视频不适用于移动横幅