前提・実現したいこと
pythonのflaskでweb公開したいです
このエラーはlinuxのサーバーでファイルを見て出たエラーです。
発生している問題・エラーメッセージ
エラーメッセージ File "./public_html/d.py", line 13, in <module> app.run(debug=False, host='0.0.0.0', port=80) File "/usr/local/python/lib/python3.5/site-packages/flask/app.py", line 843, in run run_simple(host, port, self, **options) File "/usr/local/python/lib/python3.5/site-packages/werkzeug/serving.py", line 694, in run_simple inner() File "/usr/local/python/lib/python3.5/site-packages/werkzeug/serving.py", line 656, in inner fd=fd) File "/usr/local/python/lib/python3.5/site-packages/werkzeug/serving.py", line 550, in make_server passthrough_errors, ssl_context, fd=fd) File "/usr/local/python/lib/python3.5/site-packages/werkzeug/serving.py", line 464, in __init__ HTTPServer.__init__(self, (host, int(port)), handler) File "/usr/local/python/lib/python3.5/socketserver.py", line 443, in __init__ self.server_bind() File "/usr/local/python/lib/python3.5/http/server.py", line 138, in server_bind socketserver.TCPServer.server_bind(self) File "/usr/local/python/lib/python3.5/socketserver.py", line 457, in server_bind self.socket.bind(self.server_address) PermissionError: [Errno 13] Permission denied
該当のソースコード
python
1ソースコード 2#!/usr/local/bin/python3 3 4 5from flask import Flask 6app = Flask(__name__) 7 8@app.route('/') 9def hello(): 10 name = "Hello World" 11 return name 12 13 14app.run(debug=False, host='0.0.0.0', port=80) 15
試したこと
自分が使えるwebサーバーを持ってます。public_htmlにこのプログラムを公開しましたがInternal Server Errorが出ます。
補足情報(FW/ツールのバージョンなど)
全くの初心者です。flaskを使ったpythonのweb公開とディレクトリの配置場所が知りたいです。よろしくお願いします。
回答3件
あなたの回答
tips
プレビュー