本文整理汇总了Python中google.appengine.ext.appstats.recording.appstats_wsgi_middleware方法的典型用法代码示例。如果您正苦于以下问题:Python recording.appstats_wsgi_middleware方法的具体用法?Python recording.appstats_wsgi_middleware怎么用?Python recording.appstats_wsgi_middleware使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类google.appengine.ext.appstats.recording
的用法示例。
在下文中一共展示了recording.appstats_wsgi_middleware方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_instance
# 需要导入模块: from google.appengine.ext.appstats import recording [as 别名]
# 或者: from google.appengine.ext.appstats.recording import appstats_wsgi_middleware [as 别名]
def get_instance():
global _instance
if _instance is not None:
return _instance
from webapp2 import WSGIApplication
from argeweb.core import errors
from argeweb.core import routing
settings, s = get_setting()
appstats_settings = s['appstats']
app_config_settings = s['app_config']
debug = True
_instance = WSGIApplication(
debug=debug, config=app_config_settings)
# Custom Error Handlers
if debug is False:
_instance.error_handlers[400] = errors.handle_400
_instance.error_handlers[401] = errors.handle_401
_instance.error_handlers[403] = errors.handle_403
_instance.error_handlers[404] = errors.handle_404
_instance.error_handlers[500] = errors.handle_500
routing.auto_route(_instance.router, debug, version)
return recording.appstats_wsgi_middleware(_instance)
示例2: webapp_add_wsgi_middleware
# 需要导入模块: from google.appengine.ext.appstats import recording [as 别名]
# 或者: from google.appengine.ext.appstats.recording import appstats_wsgi_middleware [as 别名]
def webapp_add_wsgi_middleware(app):
from google.appengine.ext.appstats import recording
app = recording.appstats_wsgi_middleware(app)
return app
示例3: webapp_add_wsgi_middleware
# 需要导入模块: from google.appengine.ext.appstats import recording [as 别名]
# 或者: from google.appengine.ext.appstats.recording import appstats_wsgi_middleware [as 别名]
def webapp_add_wsgi_middleware(app):
from google.appengine.ext.appstats import recording
app = recording.appstats_wsgi_middleware(app)
return app
示例4: webapp_add_wsgi_middleware
# 需要导入模块: from google.appengine.ext.appstats import recording [as 别名]
# 或者: from google.appengine.ext.appstats.recording import appstats_wsgi_middleware [as 别名]
def webapp_add_wsgi_middleware(app):
if DEBUG:
from google.appengine.ext.appstats import recording
app = recording.appstats_wsgi_middleware(app)
return app