Commit 9bc2719a authored by Hanno Schlichting's avatar Hanno Schlichting

Split a WSGI part out of `Zope2.Startup.ZopeStarter`.

If Zope is run as a WSGI app, this avoids doing any ZServer related work.
parent c6ed1908
...@@ -21,6 +21,8 @@ Features Added ...@@ -21,6 +21,8 @@ Features Added
Restructuring Restructuring
+++++++++++++ +++++++++++++
- Split a WSGI part out of `Zope2.Startup.ZopeStarter`.
- Add new `Zope2.Startup.config` module to hold configuration. - Add new `Zope2.Startup.config` module to hold configuration.
- Remove `Control_Panel` `/DebugInfo` and `/DavLocks`. - Remove `Control_Panel` `/DebugInfo` and `/DavLocks`.
......
This diff is collapsed.
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
def run(): def run():
""" Start a Zope instance """ """ Start a Zope instance """
import Zope2.Startup import Zope2.Startup
starter = Zope2.Startup.get_starter() starter = Zope2.Startup.get_starter(wsgi=False)
opts = _setconfig() opts = _setconfig()
starter.setConfiguration(opts.configroot) starter.setConfiguration(opts.configroot)
try: try:
...@@ -33,11 +33,10 @@ def configure(configfile): ...@@ -33,11 +33,10 @@ def configure(configfile):
follows: from Zope2.Startup.run import configure; follows: from Zope2.Startup.run import configure;
configure('/path/to/configfile'); import Zope2; app = Zope2.app() """ configure('/path/to/configfile'); import Zope2; app = Zope2.app() """
import Zope2.Startup import Zope2.Startup
starter = Zope2.Startup.get_starter() starter = Zope2.Startup.get_starter(wsgi=True)
opts = _setconfig(configfile) opts = _setconfig(configfile)
starter.setConfiguration(opts.configroot) starter.setConfiguration(opts.configroot)
starter.setupSecurityOptions() starter.setupSecurityOptions()
starter.dropPrivileges()
return starter return starter
...@@ -65,7 +64,7 @@ def make_wsgi_app(global_config, zope_conf): ...@@ -65,7 +64,7 @@ def make_wsgi_app(global_config, zope_conf):
from Zope2.Startup.handlers import handleConfig from Zope2.Startup.handlers import handleConfig
from Zope2.Startup.options import ZopeOptions from Zope2.Startup.options import ZopeOptions
from ZPublisher.WSGIPublisher import publish_module from ZPublisher.WSGIPublisher import publish_module
starter = get_starter() starter = get_starter(wsgi=True)
opts = ZopeOptions() opts = ZopeOptions()
opts.configfile = zope_conf opts.configfile = zope_conf
opts.realize(args=(), progname='Zope2WSGI', raise_getopt_errs=False) opts.realize(args=(), progname='Zope2WSGI', raise_getopt_errs=False)
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment