def _get_basic_auth_info(request):
 (meth, auth) = request.META['HTTP_AUTHORIZATION'].split()
 if (meth.lower() != 'basic'):
  raise ValueError
 (username, password) = base64.b64decode(auth).split(':')
 return (username, password)

def _get_basic_auth_info ( request ) : ( meth , auth ) = request . META [ 'HTTP_AUTHORIZATION' ] . split ( ) if ( meth . lower ( ) != 'basic' ) : raise ValueError ( username , password ) = base64 . b64decode ( auth ) . split ( ':' ) return ( username , password )
grab basic auth info .