django - social-django 包在尝试登录 facebook 时显示错误
问题描述
当我试图在 django 中使用 facebook social-django 作为一个包时,它会显示一个错误,例如,
Insecure Login Blocked: You can't get an access token or log in to
this app from an insecure page. Try re-loading the page as https://
我在 fb 中创建了一个应用程序,它的 id 和 key 已经添加到 settings.py 中。
在 fb 应用程序重定向 url 中是这样的:
对于 https,我尝试了“sslserer”,但它无法正常工作!
解决方案
Facebook 不支持主机127.0.0.1:8000
或localhost:8000
. 如果您使用的是 linux/ubuntu,请在文件末尾添加以下行/etc/hosts
127.0.1.1 myproject.com
转到您的 fb 应用程序并将 redirecturl 从更改localhost:8000
为myproject.com:8000
.
推荐阅读
- ruby - 正则表达式不匹配带括号的新行
- angular - 角度未定义的属性,但这是不可能的
- ruby - 让!与 Rspec 中的 let 和之前
- android - 如何修复 AppBarlayout 和 TabLayout 之间的差距
- javascript - Angular javascript 检测和安装 jdk
- r - 直接将 r-markdown 发布到 rpubs
- angularjs - Angularjs ng-repeat 无法按预期工作
- javascript - _gaq.push 在谷歌分析中不起作用
- python - 缩放图形而不缩放标签、文本和轴刻度等
- python - 如何使用`bokeh.models.expressions`