Facebook Connect:使用django-profile和django-socialregistration捕获用户数据 [英] Facebook Connect: capturing user data with django-profiles and django-socialregistration

查看:151
本文介绍了Facebook Connect:使用django-profile和django-socialregistration捕获用户数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的谷歌搜索完全离开了我,或者几乎没有任何关于 django-socialregistration 的文档/教程。太糟糕了,因为它似乎是一个很好的应用程序。通过一些尝试和错误,我已经设法让它主要在我的网站上运行。



我的问题是,使用 django-socialregistration 如何请求Facebook用户的全名,当前城市和出生日期的存储权限在我的UserProfile表(这是我的AUTH_PROFILE_MODULE为django-profiles)Django注册后?另外,一旦连接完成,怎么才能从Django发布到用户的墙上?



目前,当我点击与Facebook连接按钮时,Facebook连接被创建,将创建一个新的Django用户,并且该用户使用该Django帐户登录。但是,没有创建UserProfile,并且没有保存Facebook个人资料数据。



任何Facebook连接大师,想帮助Django小马飞往Facebookland?



设置:

- Django 1.2.1

- Python 2.5.2

- django-socialregistration 0.4.2

- django-registration 0.7

- django-profiles 0.2





请问先生,请帮我找到魔法的Facebookland吗?

解决方案

在facebook_js.html中,您需要调整以下行,取消注释您需要从FB获取的项目: / p>

  FB.login(handleResponse / *,{perms:'publish_stream,sms,offline_access,email,read_stream,status_update等) * /); 

然后,在FacebookMiddleware中,您可以从 fb_user 中提取数据,像这样:

  facebook.GraphAPI(fb_user ['access_token'])。get_object('me')


Either my google searching has completely left me or there's hardly any documentation/tutorials for django-socialregistration. Too bad, because it seems like a nice enough app. Through some trial-and-error, I have managed to get it mostly running on my site.

My question, using django-socialregistration how do I request permission for the facebook user's full name, current city and date of birth and store it in my UserProfile table (which is my AUTH_PROFILE_MODULE for django-profiles) in Django upon registration? Also, how do I post to the user's wall from Django once the connection is made?

Currently, when I click the "Connect with Facebook" button the facebook connection is made, a new Django user is created and the user is logged in with that Django account. However, no UserProfile is created and no facebook profile data is saved.

Any facebook connect gurus out there want to help the Django pony fly to Facebookland?

Setup:
- Django 1.2.1
- Python 2.5.2
- django-socialregistration 0.4.2
- django-registration 0.7
- django-profiles 0.2


"Kind sir, can you please help me find the magical Facebookland?"

解决方案

In facebook_js.html you need to adjust the following line, by uncommenting items that you need to get from FB:

     FB.login(handleResponse/*,{perms:'publish_stream,sms,offline_access,email,read_stream,status_update,etc'}*/);

Then, in FacebookMiddleware you can extract that data from fb_user, like this:

     facebook.GraphAPI(fb_user['access_token']).get_object('me')

这篇关于Facebook Connect:使用django-profile和django-socialregistration捕获用户数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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