Help us understand the problem. What is going on with this article?

flaskのweb公開ができなかった日

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

Why do not you register as a user and use Qiita more conveniently?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away