Why does running the Flask dev server run itself twice?

前端 未结 6 2114
南旧
南旧 2020-11-22 01:39

I\'m using Flask for developing a website and while in development I run flask using the following file:

#!/usr/bin/env python
from datetime import datetime
         


        
6条回答
  •  粉色の甜心
    2020-11-22 02:32

    I had the same issue. I solved it by modifying my main and inserting use_reloader=False into it. If any body is here looking for a workaround for this problem then below code will get you started, however you will the functionality of changes in code being detected automatically by and restarting the application will not work. You will have to manually stop and restart you application after each edit in code.

    if __name__ == '__main__':
        app.run(debug=True, use_reloader=False)
    

提交回复
热议问题