parameters: (self, username, password, from_page='..', **kwargs)
docstring: Login. May raise redirect, or return True if request handled.
docstring_summary: Login. May raise redirect, or return True if request handled.
docstring_tokens: Login . May raise redirect or return True if request handled .
function: def do_login(self, username, password, from_page='..', **kwargs):
          """Login. May raise redirect, or return True if request handled."""
          response = cherrypy.serving.response
          error_msg = self.check_username_and_password(username, password)
          if error_msg:
              body = self.login_screen(from_page, username, error_msg)
              response.body = body
              if 'Content-Length' in response.headers:
                  # Delete Content-Length header so finalize() recalcs it.
                  del response.headers['Content-Length']
              return True
          else:
              cherrypy.serving.request.login = username
              cherrypy.session[self.session_key] = username
              self.on_login(username)
              raise cherrypy.HTTPRedirect(from_page or '/')
function_tokens: def do_login ( self , username , password , from_page = '..' , * * kwargs ) : response = cherrypy . serving . response error_msg = self . check_username_and_password ( username , password ) if error_msg : body = self . login_screen ( from_page , username , error_msg ) response . body = body if 'Content-Length' in response . headers : # Delete Content-Length header so finalize() recalcs it. del response . headers [ 'Content-Length' ] return True else : cherrypy . serving . request . login = username cherrypy . session [ self . session_key ] = username self . on_login ( username ) raise cherrypy . HTTPRedirect ( from_page or '/' )