I just start learning Python + Tornado for my web servers. Every time I modify some code on my python scripts or templates I have to stop the in my terminal (CTRL+C) and restart it (python server.py) and I want a more effective way to do this, that after modifying code in some files the server automatically restarts.
Previously I working with NodeJS and using supervisor to do this.
Also there is a way to reload my tab in Google Chrome so I can see the changes without reloading (F5)
Currently I’m using Ubuntu 11.10 and Sublime Text 2 and using CTRL+B on sublime text, but if the server is already running generates an error because the address and port is in use. There is a fix for that without changing the port.
Thanks.
If you are looking for automatic reloading of .py files during development. In your
tornado.web.Application()putdebug=Trueafter your handlers.I don’t think you should do this in production environment, because such implementation typically use a background thread to actively scan files for changes, which may slow down your application.