Can't call a decorator within the imported sub-class of a cherrpy application (site tree)
问题 I am using cherrypy as a web server, and I want to check a user's logged-in status before returning the page. This works on methods in the main Application class (in site.py ) but gives an error when I call the same decorated function on method in a class that is one layer deeper in the webpage tree (in a separate file). validate_user() is the function used as a decorator. It either passes a user to the page or sends them to a 401 restricted page, as a cherrypy.Tool , like this: from user