
* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.
* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.
맥을 쓰고있고, localhost 5001로 연결했는데 화면이 뜨지않습니다.
[에러메세지]
(venv) saeeunlee@saeeunui-MacBookPro 03.pedia %
(venv) saeeunlee@saeeunui-MacBookPro 03.pedia % /Users/saeeunlee/Desktop/sparta/Projects/03.pedia/venv/bin/python /Users/saeeunlee/Desktop/sparta/Projects/03.pedi
a/app.py
* Serving Flask app 'app'
* Debug mode: on
WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
* Running on all addresses (0.0.0.0)
* Running on http://127.0.0.1:5001
* Running on http://10.0.0.24:5001
Press CTRL+C to quit
* Restarting with stat
* Debugger is active!
* Debugger PIN: 817-269-586
127.0.0.1 - - [11/Jan/2023 12:49:09] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [11/Jan/2023 12:49:16] "GET / HTTP/1.1" 200 -
* Detected change in '/Users/saeeunlee/Desktop/sparta/Projects/03.pedia/app.py', reloading
* Restarting with stat
* Debugger is active!
* Debugger PIN: 817-269-586
/Users/saeeunlee/Desktop/sparta/Projects/03.pedia/venv/bin/python /Users/saeeunlee/Desktop/sparta/Projects/03.pedia/app.py
127.0.0.1 - - [11/Jan/2023 12:50:55] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [11/Jan/2023 12:51:09] "GET / HTTP/1.1" 200 -
/Users/saeeunlee/Desktop/sparta/Projects/03.pedia/venv/bin/python /Users/saeeunlee/Desktop/sparta/Projects/03.pedia/app.py
[코드]
from flask import Flask, render_template, request, jsonify
app = Flask(__name__)
@app.route('/')
def home():
return render_template('index.html')
@app.route("/movie", methods=["POST"])
def movie_post():
sample_receive = request.form['sample_give']
print(sample_receive)
return jsonify({'msg':'POST 연결 완료!'})
@app.route("/movie", methods=["GET"])
def movie_get():
return jsonify({'msg':'GET 연결 완료!'})
if __name__ == '__main__':
app.run('0.0.0.0', port=5001, debug=True)
