Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django: Full fledge Facebook and Twitter integration (Django-Facebook, django-social-auth, django-allauth)

Before I post my question I would like to tell you that I'm aware of few excellent django packages out there for twitter and facebook integration:

  • Django-Facebook
  • django-social-auth
  • django-allauth

So, here's my question:

What I want?

I want to:

  1. Allow users to registration via facebook and twitter. (easy to implement using any of above).
  2. Allow multiple social accounts integration into one user account. (I think both #2 and #3 can do it.)
  3. Create profile from facebook or twitter data (needs extended permissions in case of fb). So, it means we also need to access data from facebook and twitter.
  4. Allow user to post to facebook and twitter from django app (activity as well as via forms).
  5. Inviting and Finding facebook friends (#3 can do it.)
  6. Provide same functionality as facebook app. (#3 can do it.)
  7. Post to user's owned facebook page. (I'm not sure if #3 can do it.)

What I think

If I had to deal with facebook only then I think Django-Facebook answers almost all of my questions. But since I also want to support twitter I'm not sure what I should do. All I can think of:

  1. Django-Facebook for facebook + django-social-auth or django-allauth for twitter. I'm not sure if this combination can work. Please let me know if you tried anything like that.
  2. django-social-auth or django-allauth only if any of these can provide aforementioned facebook functionality as well.

[Edit:] Actually I'm looking for answers to both of the following questions:

  1. If I choose to use django-social-auth only then can somebody point me to the samples/code snippets for interacting with facebook and twitter.
  2. If I want to use Django-Facbook (because it provides lot of functionality), can I choose it for facebook and django-social-auth (or django-allauth) for twitter only. I mean to say everything related to facebook using Django-facebook and everything related to twitter using social-auth or allauth. Will this combination work?

Thanks for your valuable suggestions in advance.

like image 356
Humble Learner Avatar asked Jul 12 '12 04:07

Humble Learner


People also ask

How does Django Allauth work?

django-allauth is an integrated set of Django applications dealing with account authentication, registration, management, and third-party (social) account authentication. It is one of the most popular authentication modules due to its ability to handle both local and social logins.

How does Django integrate social login?

Django Setup Set up the initial tables and add a superuser: $ python manage.py migrate Operations to perform: Apply all migrations: admin, contenttypes, auth, sessions Running migrations: Applying contenttypes. 0001_initial... OK Applying auth. 0001_initial... OK Applying admin.


1 Answers

django-social-auth is concerned with its namesake: authentication. The first 3 items in your list deal with authentication (plus profiles), so I'd use django-social-auth for those.

The rest are interactions with the various services and would best be served by other libraries like the one you mentioned (django-facebook etc.). django-social-auth will take care of access tokens and permissions, so you can use these in conjunction with the other apps to perform API operations.

like image 182
Timmy O'Mahony Avatar answered Oct 20 '22 16:10

Timmy O'Mahony