这部分内容虽然不多,但是看了好多天。 在 tgadmin 自动生成的 appname/appname/controller.py 中有如下代码: 1 import turbogears as tg 2 from turbogears import controllers, expose, flash 3 from cherrypy import request 4 # from sandbox import model 5 # import logging 6 # log = logging.getLogger(“sandbox.controllers”) 7 8 class Root(controllers.RootController): 9 @expose(template=“sandbox.templates.welcome“) 10 def index(self): 11 import time 12 # log.debug(“Happy TurboGears Controller …