커뮤니티
포인트
쿠폰
내 강의실
국비 신청 내역
증명서
계정
로그아웃
학습 질문
개발 일지
나의 활동
답변 완료
4주차 숙제 설명관련 문의
undefined주차
북마크
박*얀
댓글
2
추천
0
조회수
16
조회수
16
답변 완료

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

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


app.py 코드스니펫 복사후 붙혀넣으면 아래와 같은데

from flask import Flask, render_template, request, jsonify

app = Flask(__name__)


@app.route('/')

def home():

  return render_template('index.html')


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

def homework_post():

  sample_receive = request.form['sample_give']

  print(sample_receive)

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


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

def homework_get():

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


if __name__ == '__main__':

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


숙제영상 설명중 1분33초에보면

get 요청 하는 부분이 아래와 같이 갑자기 바뀌어있습니다


@app.route("/homework", methods=["GET"]) def homework_get(): comment_list = list(db.homework.find({},{'_id':False})) return jsonify({'comments':comment_list})


영상에서 이부분 입력하는게 빠진건가요?

아니면 제가 뭘 잘못 입력하거나 잘못 본건가요?


어떻게 해야할까요? 이대로 수정해서 진행하면 되는건가요?









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