LoginSignup
3
2

More than 3 years have passed since last update.

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

Last updated at Posted at 2019-09-11

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

3
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
2