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='', 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:


- --
Tres Seaver          +1 540-429-0999          tsea...@palladion.com
Palladion Software   "Excellence by Design"    http://palladion.com
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

Repoze-dev mailing list

Reply via email to