-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Diez B. Roggisch wrote: > On Monday 21 December 2009 11:35:21 Tres Seaver wrote: >> Diez B. Roggisch wrote: >>>> zopelib was a way to get egg-based deployment of Zope prior to the fully >>>> egg-based 2.12. You need either to upgrade to use Zope 2.12 (and drop >>>> zopelib), or else stay on Python 2.4. >>> Ok, I'm happy to upgrade to zope2.12. In fact, I just installed it. But >>> now obviously the recipes given on repoze.org doen't work. Googling for >>> zope2 & WSGI-integration only leads to them. >>> >>> Any suggestions on how to make zope2 work with mod_wsgi? >> The function, 'ZPublisher.WSGIPublisher.publish_module' is a WSGI >> application: likely what you need is a your_app.wsgi module which calls >> the Zope starup code and then sets that function as 'spplication'. >> Something like (untested): >> >> # foo.wsgi >> from Zope2.startup import startup >> from ZPublisher.WSGIPublisher import publish_module as application >> startup() >> >> If you need to wire in other configuration, etc., then you likely want >> to use a PasteDeploy config file. In that case, you need an "app >> factory", something like: >> >> # your_app.py >> from Zope2.startup import startup >> from ZPublisher.WSGIPublisher import publish_module >> >> def zope_app_factory(global_config, **local_config): >> startup() >> return publish_module >> >> and then configure that in Paste: >> >> [app:your_app] >> use = your_app:zope_app_factory >> >> If you get this working, let us know, and we will get something like it >> added to Zope or repoze.zope2. > > > Ok, this is what I've got so far: > > from paste import httpserver > > from Zope2.Startup.run import configure > from Zope2 import startup > configure('./etc/zope.conf') > startup() > > from ZPublisher.WSGIPublisher import publish_module as zope_application > > def application(environ, start_response): > environ["SERVER_SOFTWARE"] = "bob" > return zope_application(environ, start_response) > > > httpserver.serve(application, host='127.0.0.1', port='8080') > > > As you can see, you need to set that environ-key - otherwise, WSGIPublisher > will die. It appears in the returned headers, but other than that it doesn't > seem to have any impact.
You've found a bug in Paste: the 'SERVER_SOFTWARE' key is required in CGI, and so (implicitly) in WSGI. Your workaround is fine. > I found the actual code based on this post: > > https://mail.zope.org/pipermail/zope-dev/2009-December/038862.html > > In there, a problem is mentioned about with certain streamed content. > > And I fear I've hit that problem as well - the ZMI looks as if it's missing > parts. For example, the tab's rounded corners seem to be missing, the > tree-view of the folder-structure isn't rendered correctly and so forth. > > Any suggestions on this? I have an in-work (but stalled) branch to fix those issues. You could try un-stalling it: svn+ssh://svn.zope.org/repos/main/Zope/branches/tseaver-fix_wsgi Tres. - -- =================================================================== Tres Seaver +1 540-429-0999 tsea...@palladion.com Palladion Software "Excellence by Design" http://palladion.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAktM5nUACgkQ+gerLs4ltQ6rAQCdGsXI7SnOaeKo0JCakKtQMAx0 OCgAoMWlVkWFGTnxZB2EnDRHJTUm6yTa =znlF -----END PGP SIGNATURE----- _______________________________________________ Repoze-dev mailing list Repoze-dev@lists.repoze.org http://lists.repoze.org/listinfo/repoze-dev