def basic_auth(realm, users, encrypt=None, debug=False):
 if check_auth(users, encrypt):
  if debug:
   cherrypy.log('Auth successful', 'TOOLS.BASIC_AUTH')
  return
 cherrypy.serving.response.headers['www-authenticate'] = httpauth.basicAuth(realm)
 raise cherrypy.HTTPError(401, 'You are not authorized to access that resource')

def basic_auth ( realm , users , encrypt = None , debug = False ) : if check_auth ( users , encrypt ) : if debug : cherrypy . log ( 'Auth successful' , 'TOOLS.BASIC_AUTH' ) return cherrypy . serving . response . headers [ 'www-authenticate' ] = httpauth . basicAuth ( realm ) raise cherrypy . HTTPError ( 401 , 'You are not authorized to access that resource' )
to use basic login with a different server from gluon .