Configure Flask dev server to be visible across the network

前端 未结 14 2411
面向向阳花
面向向阳花 2020-11-21 05:57

I\'m not sure if this is Flask specific, but when I run an app in dev mode (http://localhost:5000), I cannot access it from other machines on the network (with

14条回答
  •  有刺的猬
    2020-11-21 06:41

    Add below lines to your project

    if __name__ == '__main__':
        app.debug = True
        app.run(host = '0.0.0.0',port=5005)
    

提交回复
热议问题