首页 > 解决方案 > 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://localhost:8000/

对于 https,我尝试了“sslserer”,但它无法正常工作!

标签: djangofacebook

解决方案


Facebook 不支持主机127.0.0.1:8000localhost:8000. 如果您使用的是 linux/ubuntu,请在文件末尾添加以下行/etc/hosts

127.0.1.1       myproject.com

转到您的 fb 应用程序并将 redirecturl 从更改localhost:8000myproject.com:8000.


推荐阅读