使用 django-socialregistration 并获取“Facebook”;对象没有属性“graph”;
我已经安装了 djangosocialregistration ,看起来它工作正常了一段时间,但现在我收到错误,我不知道它来自哪里。在我看来,我这样做是为了开始查看 API...
me = request.facebook.graph.get_object("me")
我得到了这个...
'Facebook' 对象没有属性 'graph'
在它停止工作后,我回滚了一些小更改,我会制作完成,重置所有内容,删除cookie,但仍然无法正常工作。我正在运行 django 1.1.1,升级对我来说有点困难,但并非不可能。我一直在重新加载一堆试图让它工作,Facebook 是否有可能限制他们的登录连接?
I've installed djangosocialregistration and it seemed like it was working fine for a while, but now I'm getting an error and I can't figure out where it's coming from. Inside my view I'm doing this to start looking at the API...
me = request.facebook.graph.get_object("me")
and I'm getting this...
'Facebook' object has no attribute 'graph'
After it quit working I rolled back a couple small changes I'd made, reset everything, deleted cookies and it's still not working. I'm running django 1.1.1 and it's slightly difficult for me to upgrade, not impossible though. I've been reloading a bunch trying to get it working, is there any possibility facebook throttles login connections on their end?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Socialregistration 中间件中的 Facebook 类如下所示:
如果在
__inii__
上没有设置用户,则不会设置graph
。在中间件中,这应该通过以下方式设置:所以我猜 Facebook 的 cookie 没有为您的网站设置。也许您添加一些调试日志记录来确定是否有来自 facebook 的 cookie。
另一种猜测是
request.facebook
在某处被覆盖。也许你也检查一下。The Facebook class in the middleware of socialregistration looks like this:
If no user is set on
__inii__
it will simply not setgraph
. In the Middleware this should be set via:So my guess that the cookie from Facebook is not set for your site. Maybe you add some debug logging to determine if there is a cookie from facebook or not.
Another guess would be that
request.facebook
is overwritten somewhere. Maybe you check this as well.