开发者

Starting Tornado Web

开发者 https://www.devze.com 2022-12-31 01:08 出处:网络
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 wit

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 Ngi开发者_如何学编程nx starts, Tornado starts?

Any help would be appreciated!


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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消