커뮤니티
포인트
로딩중
쿠폰
내 강의실
국비 신청 내역
수강권
증명서
숙제 피드백
계정
로그아웃
학습 질문
개발 일지
나의 활동
답변 완료
5-4
웹개발 종합반 v8
5주차
북마크
조*대
댓글
3
추천
0
조회수
10
조회수
10
답변 완료

* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.

* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.


App.py 를 코드스니펫에서 복사해서 실행하였는데 localhost:5001 페이지가 아예 뜨질 않네요. 하얀색 페이지로 나옵니다.



스파르타 즉문즉답




  • 작성코드

from flask import Flask, render_template, request, jsonify

app = Flask(__name__)


@app.route('/')

def home():

return render_template('index.html')


@app.route("/bucket", methods=["POST"])

def bucket_post():

sample_receive = request.form['sample_give']

print(sample_receive)

return jsonify({'msg': 'POST 연결 완료!'})

@app.route("/bucket", methods=["GET"])

def bucket_get():

return jsonify({'msg': 'GET 연결 완료!'})


if __name__ == '__main__':

app.run('0.0.0.0', port=5001, debug=True)


  • 에러코드

(venv) Jeong-Dae@mannix 04.bucket % "/Users/Jeong-Dae/Documents/Coding Club/Sparta/Projects/04.bucket/venv/bin/python" "/Users/Jeong

-Dae/Documents/Coding Club/Sparta/Projects/04.bucket/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.93:5001

Press CTRL+C to quit

 * Restarting with stat

 * Debugger is active!

 * Debugger PIN: 127-665-475

127.0.0.1 - - [12/Jun/2023 20:30:43] "GET / HTTP/1.1" 200 -

127.0.0.1 - - [12/Jun/2023 20:30:43] "GET /favicon.ico HTTP/1.1" 404 -

127.0.0.1 - - [12/Jun/2023 20:30:57] "GET / HTTP/1.1" 200 -

 * Detected change in '/Users/Jeong-Dae/Documents/Coding Club/Sparta/Projects/04.bucket/app.py', reloading

 * Restarting with stat

 * Debugger is active!

 * Debugger PIN: 127-665-475

"/Users/Jeong-Dae/Documents/Coding Club/Sparta/Projects/04.bucket/venv/bin/python" "/Users/Jeong-Dae/Documents/Coding Club/Sparta/Projects/04.bucket/app.py"

127.0.0.1 - - [12/Jun/2023 20:31:50] "GET / HTTP/1.1" 200 -

127.0.0.1 - - [12/Jun/2023 20:32:03] "GET / HTTP/1.1" 200 -

"/Users/Jeong-Dae/Documents/Coding Club/Sparta/Projects/04.bucket/venv/bin/python" "/Users/Jeong-Dae/Documents/Coding Club/Sparta/Projects/04.bucket/app.py"

127.0.0.1 - - [12/Jun/2023 20:37:22] "GET / HTTP/1.1" 200 -


취소
 공유
취소
댓글 0
댓글 알림
나의얼굴