@csrf_exempt
def admin_role(request):
 if (settings.AUTH_IP_WHITELIST and (not (get_client_ip(request) in settings.AUTH_IP_WHITELIST))):
  return HttpResponse(json.dumps({'error': 'unauthorized_request'}), status=403, content_type='application/json')
 return HttpResponse(json.dumps({'adminRole': 'admin'}), content_type='application/json')

@ csrf_exempt def admin_role ( request ) : if ( settings . AUTH_IP_WHITELIST and ( not ( get_client_ip ( request ) in settings . AUTH_IP_WHITELIST ) ) ) : return HttpResponse ( json . dumps ( { 'error' : 'unauthorized_request' } ) , status = 403 , content_type = 'application/json' ) return HttpResponse ( json . dumps ( { 'adminRole' : 'admin' } ) , content_type = 'application/json' )
check ip whitelist / blacklist .