Ann: CherryPy-2.0-beta released
Ian Bicking
ianb at colorstudy.com
Mon Jan 3 16:36:36 EST 2005
remi at cherrypy.org wrote:
> Well, you can easily run CherryPy behind Apache (see
> http://trac.cherrypy.org/cgi-bin/trac.cgi/wiki/BehindApache).
> Since CherryPy provides a WSGI interface (although it's still
> experimental), you can also run your CherryPy app with any
> WSGI-compatible HTTP server (although I don't really see any advantage
> to doing this).
In the future when more WSGI environments are deployed, I think the
benefits will be nice. For instance, under WSGIKit
(http://svn.colorstudy.com/trunk/WSGIKit) you should be able to create a
file:
# cherry_app.py:
from cherrypy import cpg, wsgiapp
from my_cherry_app import root_instance
cpg.root = root_instance
wsgiapp.init()
# This variable name is automatically picked up:
application = wsgiapp.wsgiApp
Then your application would be available under cherry_app/ (wherever you
happened to put that file in the URL space). Note that WSGIKit isn't a
server itself, just a set of middleware that delegates to different
applications.
It occurs to me that it would be considerably cleaner if it looked more
like this:
from cherrypy import wsgiapp
from my_cherry_app import root_instance
application = wsgiapp.Application(my_cheery_app)
Otherwise you can only run one CherryPy application in a process...?
That would be very limiting.
Anyway, the idea is you can deploy a CherryPy-based application fairly
easily alongside other WSGI Python web applications. The particulars
still need some work -- I don't like the little Python file used to put
the pieces together -- but I think it's a good direction.
--
Ian Bicking / ianb at colorstudy.com / http://blog.ianbicking.org
More information about the Python-list
mailing list