Why does running the Flask dev server run itself twice?

前端 未结 6 2088
南旧
南旧 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:23

    I had the same issue, and I solved it by setting app.debug to False. Setting it to True was causing my __name__ == "__main__" to be called twice.

提交回复
热议问题