How to set up autoreload with Flask+uWSGI?

后端 未结 7 1778
清酒与你
清酒与你 2020-12-13 00:41

I am looking for something like uWSGI + django autoreload mode for Flask.

7条回答
  •  一生所求
    2020-12-13 00:59

    I am afraid that Flask is really too bare bones to have an implementation like this bundled by default.

    Dynamically reloading code in production is generally a bad thing, but if you are concerned about a dev environment, take a look at this bash shell script http://aplawrence.com/Unixart/watchdir.html

    Just change the sleep interval to whatever suits your needs and substitute the echo command with whatever you use to reload uwsgi. I run uwsgi un master mode and just send a killall uwsgi command.

提交回复
热议问题