Search code examples
pythonhttpcherrypy

starting cherrypy properly


How do I properly start cherrypy? It worked for me with 3.0 but now I can serve the content but have to start my service everytime I touch the source even though the autoreloader is running.

I already added the cherrypy.engine.block() statement, which works but cherrypy stops serving my application then (no answer within the browser, even though it opens the TCP port properly).

So any clue or insight on where or what to look for?

This is on stdout:

[30/Dec/2012:17:05:28] ENGINE Bus STARTING<br>
[30/Dec/2012:17:05:28] ENGINE Started monitor thread 'Autoreloader'.<br>
[30/Dec/2012:17:05:28] ENGINE Started monitor thread '_TimeoutMonitor'.<br>
[30/Dec/2012:17:05:28] ENGINE Serving on 0.0.0.0:8080<br>
[30/Dec/2012:17:05:28] ENGINE Bus STARTED<br>
[30/Dec/2012:17:05:28] ENGINE Bus STARTING<br>
[30/Dec/2012:17:05:28] ENGINE Monitor thread 'Autoreloader' already started.<br>
[30/Dec/2012:17:05:28] ENGINE Monitor thread '_TimeoutMonitor' already started.<br>
[30/Dec/2012:17:05:28] ENGINE Already serving on 0.0.0.0:8080<br>
[30/Dec/2012:17:05:28] ENGINE Bus STARTED<br>

How I start it:

cherrypy.tree.mount(login(), '/', configPath)<br>
cherrypy.tree.mount(reservation(), '/reservation', configPath)<br>
cherrypy.tree.mount(administration(), '/reservation/administration', configPath)<br>
cherrypy.server.socket_host= "0.0.0.0"<br>
cherrypy.engine.start()

Solution

  • My Problem was the usage of and old version (actually the latest one linked on their site!) of cherrypy in conjunction with python 3.3. Taking the latest packages from bitbucket solved this for me!