Why can't I change the host and port that my Flask app runs on?

前端 未结 5 579
自闭症患者
自闭症患者 2020-11-30 08:32

I want to change the host and port that my app runs on. I set host and port in app.run, but the flask run command still r

5条回答
  •  感动是毒
    2020-11-30 08:59

    You also can use it:

    if __name__ == "__main__":
        app.run(host='127.0.0.1', port=5002)
    

    and then in the console use it

    set FLASK_ENV=development
    python app.py
    

提交回复
热议问题