2013-05-13 29 views
4

我使用django-allauth對於Facebook的身份驗證在研究與開發的網站,並建立了相應的: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進行測試。

+0

我在兩天內沒有觸及過它,現在它正常工作。萬歲的臉書。問題解決了(在它自己的)。 – mislavcimpersak 2013-05-16 13:54:55

回答

8

它爲我設置在Facebook的url爲localhost而不是127.0.0.1。同樣通過localhost:8000./manage.py runserver

+0

[在文檔中](http://django-allauth.readthedocs.org/en/latest/#facebook)「開發回調URL 將您的應用程序域名爲空並放在他的部分使用Facebook登錄的網站將此網站設置爲您的網站URL:http:// localhost:8000「 – 2013-12-22 00:55:16

0

我在一個小時前遇到了同樣的問題。我已經通過將Site URLValid OAuth redirect URIs設置爲http://fuf.me:8080來修復它。 fuf.me指向127.0.0.1,因此您的本地主機,並且我已將默認8000端口更改爲8080.您可以通過運行python manage.py runserver localhost:8080

此外,我還啓用了瀏覽器OAuthLogin和WebOauthLogin。