I’ve been doing a bit of Tornado work recently, and one of the things I really found annoying was the getting the auto reload functionality working when developing. I just couldn’t get it working, but eventually did it using the following code.

import tornado
from tornado import autoreload

tornado.options.parse_command_line()
app = MyApp()
app.listen(8888)
ioloop = tornado.ioloop.IOLoop().instance()
autoreload.start(ioloop)
ioloop.start()

I also had debug set to True in my tornado settings. After that, the server automatically restarted when my modules changes.

I hope this helps someone else getting autoreload to work.

Advertisement