def make_wsgi_app(global_config, zope_conf): from App.config import setConfiguration from Zope2.Startup import get_wsgi_starter from Zope2.Startup.handlers import handleWSGIConfig from Zope2.Startup.options import ZopeWSGIOptions from ZPublisher.WSGIPublisher import publish_module starter = get_wsgi_starter() opts = ZopeWSGIOptions(configfile=zope_conf)() if 'debug_mode' in global_config: if global_config['debug_mode'] in ('true', 'on', '1'): opts.configroot.debug_mode = True handleWSGIConfig(opts.configroot, opts.confighandlers) setConfiguration(opts.configroot) starter.setConfiguration(opts.configroot) starter.prepare() return publish_module
def get_starter(self, conf): starter = get_wsgi_starter() starter.setConfiguration(conf) return starter