from flask import Flask

app = Flask(__name__)

def index():
    return 'Hello world'

if __name__ == '__main__':
    app.run(debug=False, host='', port=80)


host='' の指定が大事。
参考: http://flask.pocoo.org/docs/0.12/quickstart/

Externally Visible Server

If you run the server you will notice that the server is only accessible from your own computer, not from any other in the network. This is the default because in debugging mode a user of the application can execute arbitrary Python code on your computer.

If you have the debugger disabled or trust the users on your network, you can make the server publicly available simply by adding --host= to the command line:

Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account log in.