Search code examples
pythonubuntutornado

Starting Tornado Web


I'm quite new to using Tornado Web as a web server, and am having a little difficulty keeping it running. I normally use Django and Nginx, and am used to start/stop/restarting the server. However with Tornado I'm having trouble telling it to "run" without directly executing my main python file for the site, ie "python ~/path/to/server.py".

I'm sure I'm getting this completely wrong - is there a way of 'bootstrapping' my script so that when Nginx starts, Tornado starts?

Any help would be appreciated!


Solution

  • No, there is not a way to have nginx spawn your tornado instance.

    Typically you would use an external framework like daemontools or a system init script to run the tornado process.