Commits

Anonymous committed bbd7019

Changed page UpgradeTo30

Comments (0)

Files changed (1)

 
 {{{
 cherrypy.tree.mount(Root())
-cherrypy.server.start()
+cherrypy.server.quickstart()
 cherrypy.engine.start()
 }}}
 
-If you used the old {{{init_only}}} argument to server.start, you should now write this:
+However, rather than make 3 separate calls to tree.mount, server.quickstart, and engine.start, there's a new cherrypy.quickstart function. To do the same thing as above, you can simply write:
 
 {{{
-cherrypy.tree.mount(Root())
-cherrypy.server.start()
-cherrypy.engine.start(blocking=False)
+cherrypy.quickstart(Root())
 }}}
 
-However, rather than make 3 separate calls to tree.mount, server.start, and engine.start, there's a new cherrypy.quickstart function. It's probably easiest to just reproduce it here in its entirety:
+Here's the function in its entirety:
 
 {{{
 def quickstart(root, script_name="", conf=None):
     engine.start()
 }}}
 
+If you used the old {{{init_only}}} argument to server.start, you should now write this:
+
+{{{
+cherrypy.tree.mount(Root())
+cherrypy.server.quickstart()
+cherrypy.engine.start(blocking=False)
+}}}
+
 You can also now mount foreign WSGI applications on the CherryPy tree using {{{cherrypy.tree.graft(app, script_name)}}}. CherryPy will automatically pass these to the builtin WSGI server if you use it (which happens by default). If you want to use some other WSGI server with CherryPy, pass cherrypy.tree as the WSGI application, and it will do application dispatching for you to all mounted apps.
 
 In addition, the revised Server class can now control more than one HTTP server. See help(cherrypy.server) for more details.