<s> from django . conf import settings <EOL> from django . contrib . auth import REDIRECT_FIELD_NAME <EOL> from django . views . decorators . csrf import csrf_exempt , csrf_protect <EOL> from django . contrib . auth . decorators import login_required <EOL> from django . views . decorators . http import require_POST <EOL> from social . utils import setting_name <EOL> from social . actions import do_auth , do_complete , do_disconnect <EOL> from social . strategies . utils import get_strategy <EOL> from social . apps . django_app . utils import strategy , BACKENDS , STORAGE <EOL> from social . apps . django_app . views import _do_login <EOL> STRATEGY = getattr ( settings , setting_name ( '<STR_LIT>' ) , <EOL> '<STR_LIT>' ) <EOL> def load_strategy ( * args , ** kwargs ) : <EOL> return get_strategy ( BACKENDS , STRATEGY , STORAGE , * args , ** kwargs ) <EOL> @ strategy ( '<STR_LIT>' , load_strategy = load_strategy ) <EOL> def auth ( request , backend ) : <EOL> return do_auth ( request . strategy , redirect_name = REDIRECT_FIELD_NAME ) <EOL> @ csrf_exempt <EOL> @ strategy ( '<STR_LIT>' , load_strategy = load_strategy ) <EOL> def complete ( request , backend , * args , ** kwargs ) : <EOL> return do_complete ( request . strategy , _do_login , request . user , <EOL> redirect_name = REDIRECT_FIELD_NAME , * args , ** kwargs ) <EOL> @ login_required <EOL> @ strategy ( load_strategy = load_strategy ) <EOL> @ require_POST <EOL> @ csrf_protect <EOL> def disconnect ( request , backend , association_id = None ) : <EOL> return do_disconnect ( request . strategy , request . user , association_id , <EOL> redirect_name = REDIRECT_FIELD_NAME ) </s>
