django allauth facebook本地开发

标签 django facebook django-allauth

我正在使用 django-allauth用于网站开发中的 Facebook 身份验证并进行相应设置:

在 facebok 的 facebook 应用程序设置中:

Namespace: test_login
App Domains: blank
Site URL: http://127.0.0.1:8000/
Canvas URL: http://127.0.0.1:8000/
Secure Canvas URL: https://127.0.0.1:8000/

在 Django 管理中我创建了新的社交应用:

Provider: Facebook
name: test_login
client_id: xxx
Secret: xxx
Sites: http://127.0.0.1:8000/

如您所见,我添加了一个新站点 http://127.0.0.1:8000/ 而不是 example.com

settings.py 中的 SITE_ID 是正确的。

所以一切都应该正常工作,但事实并非如此。单击通过 Facebook 登录后,我得到

Given URL is not allowed by the Application configuration.: 
One or more of the given URLs is not allowed by the App's settings. 
It must match the Website URL or Canvas URL, or the domain must be a 
subdomain of one of the App's domains.

我错过了什么?什么没有配置?据我所知,我应该能够使用 127.0.0.1:8000 进行测试。

最佳答案

将 Facebook 中的 url 设置为 localhost 而不是 127.0.0.1 对我很有用。同时将 localhost:8000 传递给 ./manage.py runserver

关于django allauth facebook本地开发,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16524499/

相关文章:

javascript - 使用ajax时Django不渲染数据

python - uWSGI-导入错误: No module named os

python - 覆盖注册 View django-allauth

Django和数据库生成的uuid

python - Django Rest Framework - 具有 "."、 "-"、 "_"字符的字段用户名

android - Facebook 共享 session 未打开错误

facebook - 通过 facebook api 获取两个 Facebook id 之间的关系( friend , friend 的 friend )

javascript - Facebook FB.login 在 Safari 中有效,但在移动版 Safari 中无效

python - Django allauth 和 facebook : Given URL is not allowed by the Application configuration

nginx - Facebook oauth 身份验证重定向到本地主机而不是我的域