[Web-SIG] Ann: CherryPy-2.0-beta released

Remi Delon remi at cherrypy.org
Mon Jan 3 19:50:57 CET 2005


Ian,

>> Here is a non-exhaustive list of CherryPy-2 features:
>> multi-threaded HTTP server, XML-RPC server, sessions, form handling,
>> authentication, unicode support, gzip-compression, virtual hosting,
>> WSGI adapter (experimental)
> 
> 
> I'm curious, what does the WSGI invocation look like?  Or, what would 
> you like it to look like?  I ask since it's kind of an open issue at 
> this point.

Here is a some sample code that uses a CherryPy WSGI app and the 
"WSGIServer" from PEAK:

# from cherrypy import cpg, wsgiapp
# class Root:
#     def index(self, name = "world"):
#         return "Hello, %s" % name
#     index.exposed = True
# cpg.root = Root()
#
#
# if __name__ == "__main__":
#     wsgiapp.init() # Read the CherryPy config file and initialize some 
variables
#     server_address = ("", 8000)
#     httpd = WSGIServer(server_address, WSGIRequestHandler)
#     httpd.set_app(wsgiapp.wsgiApp)
#     sa = httpd.socket.getsockname()
#     print "Serving HTTP on", sa[0], "port", sa[1], "..."
#     httpd.serve_forever()


Remi


More information about the Web-SIG mailing list