def response_authenticate():
 response = HttpResponse(status=401)
 response['WWW-Authenticate'] = 'Basic realm="Git"'
 return response

def response_authenticate ( ) : response = HttpResponse ( status = 401 ) response [ 'WWW-Authenticate' ] = 'Basic realm="Git"' return response
returns 401 response with authenticate header .