Python libraries for integrating Django with Facebook

I decided to write some applications using facebook and django (or even twisted, but that doesn’t matter), and now I can’t choose the right tools. I see that there are many API wrappers imposed on Python for Facebook:

  • official, but it seems the Python-SDK is no longer supported
  • new and actively developed, but seems too new Django-facebook
  • good old but not supported pyfacebook
  • simple, well thought out but not documented fandjango
  • some other very primitive tools

I saw several similar questions here, but I noticed that Facebook periodically introduces big changes to their APIs, and these tips may already be outdated or new libraries may appear. I would also like to know about the most significant differences between these libraries. And, of course, good documentation and tutorials are welcome.

+7
source share
3 answers

I think Django Facebook is a good choice for you. But my opinion is biased. I wrote this for my launch of Fashiolista.com, and we are launching it in production. (Pretty huge, so most edge cases have been resolved)

Django Facebook also includes OpenFacebook, which is the python api client for the open graphics protocol. This is the only python client I know that is fully updated and actively supported.

Take a look: https://github.com/tschellenbach/Django-facebook

PS. Just released a few new decorators that make it very easy to get started. These decorators are really very new and have caused some bugs in recent days. The project itself has been a year (since the opening of the open api schedule) and otherwise quite stable. http://www.mellowmorning.com/

+9
source

The answer really depends on what you want to achieve, as these APIs are completely different.

  • pyfacebook is for the old deprecated API.

  • python-sdk is for the "new" opengraph protocol (I would not say that it is no longer supported, since it is just a thin cover over the facebook protocol opengraph, therefore it supports all the new functions that facebook provides instantly without having to work with dev to lib) .

  • django-facebook is a higher level than python-sdk, and allows you to add Facebook connectivity features to your site, and also seems to pave the way for creating apps that live “inside” facebook, rather than just helping sites that live outside facebook to access facebook data.

  • I never heard of fandjango and github, it seems there isn’t right now, so I can not comment on it.

If you just want to add a custom login using facebook, then something like django-socialauth might work well for you.

If you want to start learning about social graphics, then python-sdk is the way to go.

I would also check if the supported functions would be supported by the opengraph protocol, which has improved over the last year, but there is a strange thing that it unfortunately does not support, while the outdated api supports ...

The best documentation is facebook itself, look at graph-explorer - it's pretty fun ...

+4
source

It depends on what you are trying to do. I had the same problem and ended up using django-social-auth , which allows you to log in via Facebook and many other social networks. It also allows you to extract a token from these networks and then use it.

For specific material for facebook, I use facebook-sdk , but since you have something that controls tokens, you can really replace it with anything if you get tired in the coming years. It also means that you can add more social networks later.

+1
source

All Articles