flaskをweb公開しようと思った
python xxxx.py すると
問題1
* Serving Flask app "hello" (lazy loading)
* Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
* Debug mode: off
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
当該urlにアクセスできません。
*flaskはデフォルトではweb公開設定になってないらしいのでapp.run部分を下のように書き換える
app.run(debug=False, host='0.0.0.0', port=80)
*もしくは起動時にhost='0.0.0.0'をしっかり指定しておく
再度アクセスするも
問題2
socket.error: [Errno 13] Permission denied
力技を使う
sudo python xxxx.py
当該urlにアクセスすると公開されていた
SUCCESS!!
参考:
https://qiita.com/tomboyboy/items/122dfdb41188176e45b5
https://teratail.com/questions/184827