0

I am using django-facebook to have facebook connect functionality in my site.

Everything is great till now, however I am trying to save the friends list in my db when the signal facebook_user_registered is called using the function get_and_store_friends.

The problem is that current get_open_graph function requires the request object which the view function recieve and I am in facebook_user_registerd and have no access to a request object in that moment.

Is it possible to do in the registartion signal ?

Nuno_147
  • 2,817
  • 5
  • 23
  • 36

1 Answers1

0

I'm currently doing this asyncronously using Celery. Django-facebook will automatically pull down users' friends on registration if you are using Celery and set the following in your settings.py:

FACEBOOK_STORE_FRIENDS = True
FACEBOOK_CELERY_STORE = True

At that point, each user will have a friends property which contains a list of FacebookUser objects with their facebook IDs and some minimal opengraph details.

Ryan Rix
  • 31
  • 5