本文整理汇总了Python中pylons.wsgiapp.PylonsApp.setup_app_env方法的典型用法代码示例。如果您正苦于以下问题:Python PylonsApp.setup_app_env方法的具体用法?Python PylonsApp.setup_app_env怎么用?Python PylonsApp.setup_app_env使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pylons.wsgiapp.PylonsApp
的用法示例。
在下文中一共展示了PylonsApp.setup_app_env方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setup_app_env
# 需要导入模块: from pylons.wsgiapp import PylonsApp [as 别名]
# 或者: from pylons.wsgiapp.PylonsApp import setup_app_env [as 别名]
def setup_app_env(self, environ, start_response):
PylonsApp.setup_app_env(self, environ, start_response)
from pylons import g
# When running tests don't load controllers or register hooks. Loading the
# controllers currently causes db initialization and runs queries.
if g.env == 'unit_test':
return
self.load()
示例2: setup_app_env
# 需要导入模块: from pylons.wsgiapp import PylonsApp [as 别名]
# 或者: from pylons.wsgiapp.PylonsApp import setup_app_env [as 别名]
def setup_app_env(self, environ, start_response):
PylonsApp.setup_app_env(self, environ, start_response)
if not self.test_mode:
if self._controllers and self._hooks_registered:
return
with self._loading_lock:
self.load_controllers()
self.register_hooks()
示例3: setup_app_env
# 需要导入模块: from pylons.wsgiapp import PylonsApp [as 别名]
# 或者: from pylons.wsgiapp.PylonsApp import setup_app_env [as 别名]
def setup_app_env(self, environ, start_response):
PylonsApp.setup_app_env(self, environ, start_response)
self.load()
示例4: setup_app_env
# 需要导入模块: from pylons.wsgiapp import PylonsApp [as 别名]
# 或者: from pylons.wsgiapp.PylonsApp import setup_app_env [as 别名]
def setup_app_env(self, environ, start_response):
PylonsApp.setup_app_env(self, environ, start_response)
self.load_controllers()
示例5: setup_app_env
# 需要导入模块: from pylons.wsgiapp import PylonsApp [as 别名]
# 或者: from pylons.wsgiapp.PylonsApp import setup_app_env [as 别名]
def setup_app_env(self, environ, start_response):
PylonsApp.setup_app_env(self, environ, start_response)
if environ.get('paste.testing'):
return
self.load()