改变flask监听的主机地址和端口号

If you use command: flask run to start http server, it's not OK to add host and port information under run function, like below:

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

but it's ok to use python flaskXXX.py to start the http server.

Using flask, the HOST and PORT infor is covered by flask command options. 

Chang it by option -h and -p.

Example: falsk run -h 0.0.0.0 -p 7777




你可能感兴趣的:(技术类)