def index(self, username=None): if cherrypy.session.get('auth', False): raise cherrypy.HTTPRedirect('/update') else: return {'username': username}