def basic_auth(request, response, realm, users, encrypt=None):

    if check_auth(request, response, realm, users, encrypt):
        return

    # inform the user-agent this path is protected
    response.headers["WWW-Authenticate"] = _httpauth.basicAuth(realm)

    return unauthorized(request, response)
Perform Basic Authentication
dataset/ETHPy150Open circuits/circuits/circuits/web/tools.py/basic_auth