本文整理匯總了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