Package: zope.app.wsgi
This package provides theWSGIPublisherApplicationclass which
exposes the object publishing machinery inzope.publisheras a
WSGI application.  It also lets us bring up the Zope application
server (parsingzope.confandsite.zcml) with a mere function
call:>>> db = zope.app.wsgi.config('zope.conf')This is especially useful for debugging.To bring up Zope and obtain the WSGI application object at the same
time, use thegetWSGIApplicationfunction.This package also provides an easy to use application factory forPasteDeploy. You can simply specify an application configuration
like this in your Paste configuration file:[app:main]
use = egg:zope.app.wsgi
config_file = %(here)s/zope.confLook for more documentation inside the package itself.CHANGES5.0 (2023-01-19)Add support for Python 3.11.Add support for Python 3.10.Drop support for Python 2.7, 3.5, 3.6.4.4 (2022-07-13)Add support for Python 3.9.Remove unused dependencies onzope.configuration,zope.error,zope.lifecycleevent,zope.session,zope.testing, and unused
test dependencies onzope.annotation,zope.login, andzope.password.4.3.0 (2020-07-06)Fix the testlayer’shttp()to pass through the request protocol as the
response protocol, for compatibility with zope.app.testing.functional’s
HTTPCaller. SeePR 21.4.2.0 (2020-03-23)Add support for Python 3.7 and 3.8.Drop support for Python 3.3 and 3.4.Fix the testlayer’shttp()to accept leading whitespace in HTTP requests,
for compatibility with zope.app.testing.functional’s HTTPCaller.Add aserver_protocolattribute toFakeResponseso you can customize
the output to be more compatible with zope.app.testing.functional’s
HTTPCaller.Drop support for running the tests usingpython setup.py test.4.1.0 (2017-04-27)Usebase64.b64encodeto avoid deprecation warning with Python 3.Add support for PyPy.Add support for Python 3.6.Fix the testlayer’sFakeResponseassuming that headers were in
unicode on Python 2, where they should usually be encoded bytes
already. This could lead to UnicodeDecodeError if the headers
contained non-ascii characters. Also make it implement__unicode__on Python 2 and__bytes__on Python 3 to ease
cross version testing. Seeissue 7.4.0.0 (2016-08-08)Update dependencies to no longer pin alpha versions of packages which already
have final releases.Drop support for Python 2.6.Claim support for Python 3.4 and 3.5. This requires to update tozope.app.appsetup>= 4.0zope.app.publication>= 4.0Fix a bug occurring in Python 3 when the principal could not be adapted toILoggingInfo.4.0.0a4 (2013-03-19)Improve Trove classifiers.FixBrowserLayer(allowTearDown=True)to actually allow tear downs.4.0.0a3 (2013-03-03)You can now specify additional WSGI middleware components wihtout
subclassing theBrowserLayerclass.toxnow uses the Zope test runner’sftestcommand to execute tests,
since setup tests cannot deal with layers, especially when they need to
spawn sub-proceeses.Switched all functional tests to useWebTestinstead ofzope.testbrowser. Set up proper layering.Do not rely onzope.testbrowser.wsgiWSGI layer support. It was not
needed anyways.Minimized theftesting.zcmlsetup.Backwards incompatibility: if you depend onzope.app.wsgi.testlayer, you
will need to requirezope.app.wsgi[testlayer] >= 4.0(version constraint
is there because older zope.app.wsgi releases did not define atestlayerextra).4.0.0a2 (2013-03-02)Fixed a bug in WSGI Test Layer setup, where the DB is not correctly set.4.0.0a1 (2013-02-28)Added support for Python 3.3.Replaced deprecatedzope.interface.implementsusage with equivalentzope.interface.implementerdecorator.Dropped support for Python 2.4 and 2.5.3.15.0 (2012-01-19)Fixed: zope.app.wsgi.paste.ZopeApplication didn’t emit
ProcessStarting events.NOTEIf an application compensated for this by generating the event, it
will need to stop or there will be multiple events
emited. (Whether or not multiple events will do any harm is
application specific.)3.14.0 (2012-01-10)Set the WSGI environment’sREMOTE_USERitem (if not already set)
with the Zope principal label. (This is the same data set in
thewsgi.logging_infoenvironment item.)This change allows user info to be used bypaste.transloggermiddleware (or
any similar middleware that usesREMOTE_USER), which provides
access logging.3.13.0 (2011-03-15)Update to zope.testbrowser 4.0.0 which uses WebTest instead of wsgi_intercept.3.12.0 (2011-01-25)Fixedzope.app.wsgi.testlayer.httpto work with changes made in
version 3.11.0.3.11.0 (2011-01-24)Movedwsgi_interceptsupport tozope.testbrowser.wsgi, thus
requiring at least version 3.11 of this package:Movedzope.app.wsgi.testlayer.Browsertozope.testbrowser.wsgi.Browser, but left BBB import here.Split upzope.app.wsgi.testlayer.BrowserLayerinto generic WSGI
browser layer (zope.testbrowser.wsgi.Layer) and ZODB/ZOPE specific
part (zope.app.wsgi.testlayer.BrowserLayeras before).3.10.0 (2010-11-18)Add pluggability for setting up WSGI middleware in testlayer.3.9.3 (2010-10-14)Python 2.7 compatibility for xmlrpc. Transplant of zope.app.testing r116141.3.9.2 (2010-05-23)Fixed test breakage due to changes in mechanize 0.2.0.3.9.1 (2010-04-24)Add support for testing XMLRPC using zope.app.wsgi.testlayer.Fix a bug in the status string handling in zope.app.wsgi.testlayer’s
FakeResponse.3.9.0 (2010-04-19)Return a FakeResponse object in zope.app.wsgi.testlayer.http,
so it becomes easier to port over tests from zope.app.testing’s
HTTPCaller.X-Powered-By header is now stripped by zope.app.wsgi.testlayer as
it is by zope.app.testing.Bugfix: initialize any <logger> defined in the config, as
zope.app.server does. (Fixes #291147)3.8.0 (2010-04-14)zope.app.wsgi.testlayer is now a lot more compatible with
the HTTPCaller() functionality in zope.app.testing, which it can
replace:same transaction behavior - pending transactions are committed
before request and synchronized afterwards.support for browser.handleErrors (for zope.testbrowser).support for clear-text (non-base64) Basic authentication headers,
which are easier to read in the tests (though not correct in
actual HTTP traffic).3.7.0 (2010-04-13)Rewrite tests in order not to dependent onzope.app.testingandzope.app.zcmlfiles.zope.app.wsgi.testlayerintroduces new testing functionality that
can replace the old functionality inzope.app.testing. In addition,
it supports usingzope.testbrowserwith WSGI directly (instead of
relying onzope.app.testing, which pulls in a lot of dependencies).The interesting parts are:zope.app.wsgi.testlayer.BrowserLayer: this sets up a minimal layer
that allows you to use the new WSGI-enabled Browser.zope.app.wsgi.testlayer.Browser: this is a subclass of Browser fromzope.testbrowser.browser. Use it instead ofzope.testbrowser.browserdirectly to use the test browser with WSGI.
You need to useBrowserLayerwith your tests for this to work.zope.app.wsgi.testlayer.http: this is the equivalent to thehttp()function inzope.app.testing. It allows low-level HTTP access
through WSGI. You need to useBrowserLayerwith your tests for
this to work.3.6.1 (2010-01-29)Support product configuration sections in Zope configuration files.3.6.0 (2009-06-20)Import database events directly fromzope.processlifetimeinstead of using BBB imports inzope.app.appsetup.3.5.2 (2009-04-03)TheWSGIPublisherApplicationuses now theILoggingInfoconcept given
from zope.publisher.interfaces.logginginfo for log user infos usable for
access logs. This allows you to implement your own access log user info
message. See zope.publisher.interfaces.logginginfo.ILoggingInfo for more
information.3.5.1 (2009-03-31)TheWSGIPublisherApplicationcall now provides a user name
in the environment meant for use in logs.3.5.0 (2009-02-10)Make devmode warning message more generic. We don’t nesessary have theetc/zope.conffile nowadays when using buildout-based setups.Add an application factory for Paste. So Zope application can now be
easily deployed with Paste .ini configuration like this:[app:main]
use = egg:zope.app.wsgi
config_file = %(here)s/zope.conf
handle_errors = falseThe config_file is a required argument, however the handle_errors
defaults to True if not specified. Setting it to False allows you to
make WSGIPublisherApplication not handle exceptions itself but
propagate them to an upper middleware, like WebError or something.TheWSGIPublisherApplicationconstructor andgetWSGIApplicationfunction now accept optionalhandle_errorsargument, described
above.Change mailing list address to zope-dev at zope.org instead of retired
one.3.4.1 (2008-07-30)Added Trove classifiers.NotifyWSGIPublisherApplicationCreatedevent when WSGI application is
created.Fixed deprecation warning inftesting.zcml: ZopeSecurityPolicy moved tozope.securitypolicy.3.4.0 (2007-09-14)Fixed the tests to run on Python 2.5 as well as Python 2.4.SplitgetApplicationintoconfigandgetApplicationso
thatconfigcould be reused, for example for debugging.3.4.0a1 (2007-04-22)Initial release as a separate project, corresponds tozope.app.wsgifrom Zope 3.4.0a1