【问题标题】:Facebook connect via django-socialregistrationFacebook 通过 django-socialregistration 连接
【发布时间】:2011-07-26 20:34:02
【问题描述】:

我正在尝试将 Facebook 连接添加到我的项目中。我在网上搜索了一下,发现django-socialregistration

我遵循了所有必需的说明,并且所有说明都正常工作。我创建了一个测试页面并放置了所有必要的 template_tags,Facebook 按钮显示在我的页面上。问题是当我尝试通过 Facebook 连接时,我被重定向到一个错误页面,上面写着:

API Error Code: 191
API Error Description: The specified URL is not owned by the application
Error Message: redirect_uri is not owned by the application.

可能是我的应用设置错误。这是我的域的应用设置:

Site URL : http://localhost:8000/test
Site Domain : localhost

我想,我收到此错误是因为 django-socialregistration 将我的页面重定向到其先前定义的 url。我发现,它使用 _get_next() 函数。但我不知道如何将我自己的 url 传递给这个函数。

那么,我该如何解决这个错误?来自我的应用设置?

【问题讨论】:

    标签: django redirect facebook


    【解决方案1】:

    问题在于 Facebook 无法正常使用 localhost 域。我通常做的是在我的/etc/hosts 文件中添加一个主机名example.com 作为localhost 的别名。然后,当您将站点 URL 更改为 http://example.com/test 并将域更改为 example.com 时,它应该可以与 Facebook 一起使用。

    不确定这是否真的解决了您的问题,因为我从未收到过此特定错误消息。

    【讨论】:

      猜你喜欢
      • 2011-06-30
      • 1970-01-01
      • 2011-04-27
      • 2012-01-25
      • 1970-01-01
      • 2011-01-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多