Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Djangofb Middleware does this work? what is FACEBOOK_INTERNAL? #54

Open
udox opened this issue Aug 24, 2010 · 1 comment
Open

Djangofb Middleware does this work? what is FACEBOOK_INTERNAL? #54

udox opened this issue Aug 24, 2010 · 1 comment

Comments

@udox
Copy link

udox commented Aug 24, 2010

Trying to make first Facebook app, with PyFacebook. Got as far as loading a simple canvas.fbml

The middleware doesn't seem to work, I am not getting any of the data posted from fb server being attached to request.facebook object

Looking at the middleware code it has this:
def init(self, api_key=None, secret_key=None, app_name=None,
callback_path=None, internal=None, app_id=None,
oauth2=None, oauth2_redirect=None):

but the django docs explicitly say that middleware can't be initialised with arguments... is there some trickery somewhere?

a few lines down we have:
self.internal = internal or getattr(settings, 'FACEBOOK_INTERNAL', True)

this is always True, unless you explicitly set False via settings.py ...what is this property for?

then in process_request we have:
if not self.internal:
if 'fb_sig_session_key' in request.GET and ('fb_sig_user' in request.GET or 'fb_sig_canvas_user' in request.GET):
request.facebook.session_key = request.session['facebook_session_key'] = request.GET['fb_sig_session_key']
request.facebook.uid = request.session['facebook_user_id'] = request.GET['fb_sig_user'] or request.GET['fb_sig_canvas_user']

this never runs unless you set FACEBOOK_INTERNAL=False
and besides, Facebook are POSTing the data to us rather than GET

Am I missing the point here? It seems like this code doesn't do what it's supposed to.

@udox
Copy link
Author

udox commented Aug 24, 2010

ok, I see decorator_from_middleware_with_args will __init__ a middleware class with args

what's the internal flag for? and how about the GET/POST discrepancy?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants