How can I get Bottle to restart on file change?

后端 未结 4 1469
长情又很酷
长情又很酷 2020-12-29 20:29

I\'m really enjoying Bottle so far, but the fact that I have to CTRL+C out of the server and restart it every time I make a code change is a big hit on my productivity. I\'v

4条回答
  •  醉梦人生
    2020-12-29 20:56

    Use reloader=True in run(). Keep in mind that in windows this must be under if __name__ == "__main__": due to the way the multiprocessing module works.

    from bottle import run
    
    if __name__ == "__main__":
        run(reloader=True)
    

提交回复
热议问题