我在用着Django-allauth https://github.com/pennersr/django-allauth对于正在开发的网站的 Facebook 身份验证,并进行了相应的设置:
在 facebook 的 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
供测试用。