问题
I'm able to run the flask app on the local system using app.run()
. But when I try to run it on remote server using app.run(host='0.0.0.0',port='81')
or app.run(host='<remote ip>')
,both don't work. I want to know if something else has to be done.
回答1:
The problem is not from Flask,
The IP specified in app.run(host='0.0.0.0')
must be owned by your server.
If you want to launch Flask on remote server, deploy the code on that server using SSH and run it using a remote session.
来源:https://stackoverflow.com/questions/31889124/how-to-run-a-flask-app-on-a-remote-server-from-a-local-system