[Zope3-dev] WSGI support, Twisted, cool!
Stephan Richter
srichter at cosmos.phy.tufts.edu
Wed Apr 13 10:04:13 EDT 2005
Hi Martijn,
it's good to see that someone other than me is monitoring the check-ins and
this response allows me to give an update about the server code.
On Wednesday 13 April 2005 06:42, Martijn Faassen wrote:
> This is just a little cheerleading note. I saw that Stephan is working
> on WSGI support (extending the earlier efforts?) as well as Twisted
> integration.
Thanks!
> Does this mean Zope 3 can be connected to any WSGI server now in theory?
Yes, though WSGI is not as much magic as everyone expects. If you want to
connect to another Web server, you will have to write some glue code, but it
demonstrated in the zope/app/wsgi/README.txt file what has to be done. I hope
that through the Twisted integration we will see some opportunity to
generalize and *maybe* we can find a way to allow changing servers by
modifying a couple of lines in a configuration file.
> And the WSGI support in ZServer mean that Zope 3 can function as a WSGI
> server itself?
Yes. Instead of passing in a request factory, as it is the case for the
publisher HTTP server, you pass in the application callable. This is very
easy indeed. Note though, that we are not planning to support zope.server
anymore and we will switch to twisted only. I basically did the ZServer WSGI
version as an exercise for the Twisted integration.
> Is the Twisted integration based on WSGI?
Twisted is not integrated yet; I have only created a link to their repository
and made the required license remarks. But the new twisted.web2 code is WSGI
compliant and we will connect to it via WSGI. But the first step will have to
be to throw out the old ZServer loop and replace it by Twisted's. Once this
is done, adding servers, be it HTTP (via WSGI or not), FTP, SMTP, or others
should be a fairly straightforward task. Also note that WSGI makes it much
harder to include the user in the logging (i.e. the current approach will not
work) and it will be trickier to implement clean server shutdowns and
restarts.
Since Itamar lives in Cambridge these days, we are going to meet this weekend
and work on the full Twisted integration. I hope that foom (James), the
author of twisted.web2, will be able to join us as well.
> I'd be interested in seeing
> Apache mod_python integration using WSGI as well, though I think
> mod_python WSGI support is still behind...
I think Phillip v. W. wants to look into this.
> I really think such efforts to make Zope 3 play nice with other systems,
> frameworks and the like, are extremely important, so again thank you
> Stephan for working on this! This will Zope 3 be perceived as a good
> citizen within the Python community, which is a good thing as right now
> people are still easily turned off by it.
Thanks, but actually I am just interested in the Twisted integration, since I
really want to see how we can hookup other protocols such as SMTP and POP3 to
Zope 3. Jim really wanted WSGI for the HTTP server and since Twisted supports
it I thought I learn about it some more; thus the documentation cleanups and
interfaces.
Regards,
Stephan
--
Stephan Richter
CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training
More information about the Zope3-dev
mailing list