You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: