<s> from django . conf import settings <EOL> from django . contrib . sites . models import Site <EOL> from django . core . urlresolvers import reverse <EOL> from socialregistration . clients . oauth import OAuth2 <EOL> from socialregistration . settings import SESSION_KEY <EOL> import json <EOL> import facebook <EOL> class Facebook ( OAuth2 ) : <EOL> client_id = getattr ( settings , '<STR_LIT>' , '<STR_LIT>' ) <EOL> secret = getattr ( settings , '<STR_LIT>' , '<STR_LIT>' ) <EOL> scope = getattr ( settings , '<STR_LIT>' , '<STR_LIT>' ) <EOL> auth_url = '<STR_LIT>' <EOL> access_token_url = '<STR_LIT>' <EOL> graph = None <EOL> _user_info = None <EOL> def get_callback_url ( self , ** kwargs ) : <EOL> if self . is_https ( ) : <EOL> return '<STR_LIT>' % ( Site . objects . get_current ( ) . domain , <EOL> reverse ( '<STR_LIT>' ) ) <EOL> return '<STR_LIT>' % ( Site . objects . get_current ( ) . domain , <EOL> reverse ( '<STR_LIT>' ) ) <EOL> def get_user_info ( self ) : <EOL> if self . _user_info is None : <EOL> self . graph = facebook . GraphAPI ( self . _access_token ) <EOL> self . _user_info = self . graph . request ( '<STR_LIT>' ) <EOL> return self . _user_info <EOL> @ staticmethod <EOL> def get_session_key ( ) : <EOL> return '<STR_LIT>' % SESSION_KEY </s>
