This package provides the WSGIPublisherApplication class which
exposes the object publishing machinery in zope.publisher as a
WSGI application. It also lets us bring up the Zope application
server (parsing zope.conf and site.zcml) with a mere function
>>> 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 the getWSGIApplication function.
This package also provides an easy to use application factory for
PasteDeploy. You can simply specify an application configuration
like this in your Paste configuration file:
use = egg:zope.app.wsgi
config_file = %(here)s/zope.conf
Look for more documentation inside the package itself.
- Use base64.b64encode to avoid deprecation warning with Python 3.
- Add support for PyPy.
- Add support for Python 3.6.
- Fix the testlayer’s FakeResponse assuming 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. See issue 7.
- 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 to
- zope.app.appsetup >= 4.0
- zope.app.publication >= 4.0
- Fix a bug occurring in Python 3 when the principal could not be adapted to
- Improve Trove classifiers.
- Fix BrowserLayer(allowTearDown=True) to actually allow tear downs.
- You can now specify additional WSGI middleware components wihtout
subclassing the BrowserLayer class.
- tox now uses the Zope test runner’s ftest command to execute tests,
since setup tests cannot deal with layers, especially when they need to
- Switched all functional tests to use WebTest instead of
zope.testbrowser. Set up proper layering.
- Do not rely on zope.testbrowser.wsgi WSGI layer support. It was not
- Minimized the ftesting.zcml setup.
- Backwards incompatibility: if you depend on zope.app.wsgi.testlayer, you
will need to require zope.app.wsgi[testlayer] >= 4.0 (version constraint
is there because older zope.app.wsgi releases did not define a testlayer
- Fixed a bug in WSGI Test Layer setup, where the DB is not correctly set.
- Added support for Python 3.3.
- Replaced deprecated zope.interface.implements usage with equivalent
- Dropped support for Python 2.4 and 2.5.
Set the WSGI environment’s REMOTE_USER item (if not already set)
with the Zope principal label. (This is the same data set in
the wsgi.logging_info environment item.)
This change allows user info to be used by paste.translogger middleware (or
any similar middleware that uses REMOTE_USER), which provides
- Update to zope.testbrowser 4.0.0 which uses WebTest instead of wsgi_intercept.
- Fixed zope.app.wsgi.testlayer.http to work with changes made in
- Moved wsgi_intercept support to zope.testbrowser.wsgi, thus
requiring at least version 3.11 of this package:
- Moved zope.app.wsgi.testlayer.Browser to
zope.testbrowser.wsgi.Browser, but left BBB import here.
- Split up zope.app.wsgi.testlayer.BrowserLayer into generic WSGI
browser layer (zope.testbrowser.wsgi.Layer) and ZODB/ZOPE specific
part (zope.app.wsgi.testlayer.BrowserLayer as before).
- Add pluggability for setting up WSGI middleware in testlayer.
- Python 2.7 compatibility for xmlrpc. Transplant of zope.app.testing r116141.
- Fixed test breakage due to changes in mechanize 0.2.0.
- Add support for testing XMLRPC using zope.app.wsgi.testlayer.
- Fix a bug in the status string handling in zope.app.wsgi.testlayer’s
- Return a FakeResponse object in zope.app.wsgi.testlayer.http,
so it becomes easier to port over tests from zope.app.testing’s
- 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)
- zope.app.wsgi.testlayer is now a lot more compatible with
the HTTPCaller() functionality in zope.app.testing, which it can
- 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).
Rewrite tests in order not to dependent on zope.app.testing and
zope.app.wsgi.testlayer introduces new testing functionality that
can replace the old functionality in zope.app.testing. In addition,
it supports using zope.testbrowser with WSGI directly (instead of
relying on zope.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 from
zope.testbrowser.browser. Use it instead of
zope.testbrowser.browser directly to use the test browser with WSGI.
You need to use BrowserLayer with your tests for this to work.
- zope.app.wsgi.testlayer.http: this is the equivalent to the http()
function in zope.app.testing. It allows low-level HTTP access
through WSGI. You need to use BrowserLayer with your tests for
this to work.
- Support product configuration sections in Zope configuration files.
- Import database events directly from zope.processlifetime
instead of using BBB imports in zope.app.appsetup.
- The WSGIPublisherApplication uses now the ILoggingInfo concept 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
- The WSGIPublisherApplication call now provides a user name
in the environment meant for use in logs.
Make devmode warning message more generic. We don’t nesessary have the
etc/zope.conf file 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:
use = egg:zope.app.wsgi
config_file = %(here)s/zope.conf
handle_errors = false
The 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.
The WSGIPublisherApplication constructor and getWSGIApplication
function now accept optional handle_errors argument, described
Change mailing list address to zope-dev at zope.org instead of retired
- Added Trove classifiers.
- Notify WSGIPublisherApplicationCreated event when WSGI application is
- Fixed deprecation warning in ftesting.zcml: ZopeSecurityPolicy moved to
- Fixed the tests to run on Python 2.5 as well as Python 2.4.
- Split getApplication into config and getApplication so
that config could be reused, for example for debugging.
Initial release as a separate project, corresponds to zope.app.wsgi
from Zope 3.4.0a1
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.