views:

138

answers:

1

I've tried to follow the advice of this question: http://stackoverflow.com/questions/984071/facebook-django-and-google-app-engine, however I've run into a number of problems. The first is that from facebook.djangofb import facebook doesn't work because when I try to use the decorator @facebook.require_login(), it complains that the facebook module doesn't have that method. If I change it to import facebook.djangofb and @facebook.djangofb.require_login(), it works. Any ideas that's going on there?

Then, even with that, I experience the same problem as in this question: http://stackoverflow.com/questions/2039366/app-engine-patch-and-pyfacebook-not-working.

It seems like a lot of people have done this, so is there a good example of how to combine PyFacebook and App Engine Patch?

+4  A: 

For your first question:

from facebook.djangofb import facebook doesn't work because when I try to use the decorator @facebook.require_login(), it complains that the facebook module doesn't have that method. If I change it to import facebook.djangofb and @facebook.djangofb.require_login(), it works.

Well, seems like require_login is on facebook.djangofb not on facebook.djangofb.facebook.

So you can do:

import facebook.djangofb
@facebook.djangofb.require_login()
...

or

from facebook import djangofb
@djangofb.require_login()
...

or

from facebook.djangofb import require_login
@require_login()
...

For the second question, did you try the answer of the other question (not using *require_login* at all, using request.fb.check_session(request) instead)? What do you get?

nosklo