views:

582

answers:

3

I want to implement Facebook connect login for my Django site and I've checked the already existing apps.

So far, I have found Django-Socialauth, django-socialregistration, and django-facebookconnect for this purpose.

The question is which one to choose, and I would like to hear from other developers who have experience with any of these apps.

It is important for me that the Facebook Connect login app plays nicely with @login_required, with the default auth system, and with django-registration.

Please share your experience :)

+1  A: 

Hi Take a look at fbconnect app that we (actually, Hernani, a guy on our team) put together for osqa (a clone of CNPROG).

You will have to, probably, tinker a bit to adapt that to your needs. It does work with @login_required decorator and the standard django.contrib.auth system, but we do not use django-registration.

Our app also works with openid and password login, but the openid part is tightly coupled with the Q&A component at present.

We may separate it though some time in the future, if anyone might be interested in "anything-signin" django pluggable app or has something better already - pls let us know.

Evgeny
A: 

I played with .NET based libraries and found them to be frustratingly out of date. Facebook seems to change their APIs frequently, so if you cannot find a library that is routinely maintained, you will find that you will get halfway through your implementation before you realize that there are serious problems.

I had some success with the javascript API that Facebook publishes and maintains. While the documentation may not be always up to date, I found that I was always within striking distance of the correct implementation (one or two changes needed).

MedicineMan
+2  A: 

I have had the most luck with adapting django-socialregistration with django-registration (0.8). Since you're working with django-registration, you're going to have to do a little bit of work, since all three of those packages assume the role of both the creation and the authentication of the user.

I was just going to explain what needed to be done, but you inspired me to finally get my version out: hello-social-registration.

Like I alluded to, it separates gives the registration functions to a django-registration backend and handles all the authorization itself. I've been using this on my near-beta application for a while now with no problems (I also handed it to a friend to use a few months ago and he got it to work without much modification).

It's definitely not ready to be a plug-and-play reusable application, yet, but hopefully it'll provide you with some insight. :)

Bryan Veloso
Looks great Bryan! I have also started working with socialregistration it works nice. I am wondering how can I retrieve first and last name of the users who have connected to the site using FB connect?(from view)I need this because I will be retrieving their first and last names at the setup view and fill the regular first and last name fields of their django accounts while saving the user. Thanks!
Hellnar
I haven't gotten that far into it, maybe I should attempt that next. :) But what you're looking for can be found here: http://code.google.com/p/django-facebookconnect/source/browse/trunk/django-facebookconnect/facebookconnect/models.py#130
Bryan Veloso