picklepete
picklepete

Reputation: 39

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!

Upvotes: 2

Views: 2543

Answers (2)

Joshua Partogi
Joshua Partogi

Reputation: 16435

A better way to do it is using supervisord as it is also written in python

Upvotes: 3

Jehiah
Jehiah

Reputation: 2779

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.

Upvotes: 2

Related Questions