커뮤니티
포인트
쿠폰
내 강의실
국비 신청 내역
증명서
계정
로그아웃
학습 질문
개발 일지
나의 활동
답변 완료
db에 저장이 안되요
undefined주차
북마크
홍*리
댓글
11
추천
0
조회수
14
조회수
14
답변 완료

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

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



강의 4-7 보고 했는데 . 연결은 됬는데 db 저장이 안되요






@app.route("/wines", methods=["POST"])
def web_wines_post():
    star_receive = request.form['star_give']
    commend_receive = request.form['commend_give']

    doc = {
        'star':star_receive,
        'commend':commend_receive
    }
    db.wines.insert_one(doc)



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





function save_order() {
    let star = $('star').val()
    let comment = $('comment').val()


    $.ajax({
        type: 'POST',
        url: '/wines',
        data: {star_give: star, comment_give: comment},
        success: function (response) {
            alert(response['msg'])
            window.location.reload()
        }
    });
}



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