django allauth facebook本地开发 [英] django allauth facebook local development

查看:130
本文介绍了django allauth facebook本地开发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 django-allauth 进行网站认证,并设置了相应地:



在facebok的Facebook应用设置中:

 命名空间:test_login 
应用程序域:空白
站点URL:http://127.0.0.1:8000/
画布URL:http://127.0.0.1:8000/
安全画布网址:https://127.0.0.1:8000/

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


$ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $
网站:http://127.0.0.1:8000/

您可以看到我添加新网站 http://127.0.0.1:8000/ 而不是 example.com



settings.py中的SITE_ID是正确的。



所以一切都应该是正常的,但不是。点击后通过Facebook登录我得到

 给定的URL不被应用程序配置允许:
一个或多个的应用程式的设定是不允许的。
它必须与网站URL或Canvas URL匹配,否则域必须是其中一个应用程序域的
子域。

我缺少什么?什么没有配置?据我所知,我应该可以使用 127.0.0.1:8000 进行测试。

解决方案

它适用于我在Facebook中将URL设置为 localhost 而不是127.0.0.1。还通过 localhost:8000 ./ manage.py runserver


I'm using django-allauth for Facebook authentication in developement for a site and have set up accordingly:

within the facebook app settings on facebok:

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/

in Django admin I created new Social app:

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

as you can see I added a new site http://127.0.0.1:8000/ instead of example.com.

The SITE_ID in the settings.py is the correct one.

So everything should be working, but it's not. After clicking to login through Facebook I get

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.

What am I missing? What isn't configured? As far as I can understand I should be able to use 127.0.0.1:8000 for testing.

解决方案

It worked for me setting the url in Facebook as localhost instead of 127.0.0.1. Also pass localhost:8000 to ./manage.py runserver

这篇关于django allauth facebook本地开发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆