커뮤니티
포인트
쿠폰
내 강의실
국비 신청 내역
증명서
계정
로그아웃
학습 질문
개발 일지
나의 활동
답변 완료
팬명록 숙제
undefined주차
북마크
정*민
댓글
9
추천
0
조회수
20
조회수
20
답변 완료
# index.html
function save_comment() {
    let name = $('#name').val()
    let comment = $('#comment').val()

    $.ajax({
        type: 'POST',
        url: '/homework',
        data: {'name_give': name, 'comment_give': comment},
        success: function (response) {
            console.log(response['msg'])
            window.location.reload()
        }
    });
}

#app.py
@app.route("/homework", methods=["POST"])
def homework_post():
    name_receive = request.form['name_give']
    comment_receive = request.form['comment_give']

    doc = {
        'name': name_receive,
        'comment': comment_receive
    }

    db.homework.insert_one(doc)

    return jsonify({'msg':'작성 완료!'})

# 서버와 클라이언트 모두 작성하였음에도 File "/Users/jeong-yeongmin/Desktop/sparta/projects/homework/venv/lib/python3.8/site-packages/pymongo/topology.py", line 238, in _select_servers_loop
    raise ServerSelectionTimeoutError(
pymongo.errors.ServerSelectionTimeoutError: ac-qogzmu1-shard-00-01.9qtx1gp.mongodb.net:27017: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108),ac-qogzmu1-shard-00-02.9qtx1gp.mongodb.net:27017: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108),ac-qogzmu1-shard-00-00.9qtx1gp.mongodb.net:27017: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108), Timeout: 30s, Topology Description: <TopologyDescription id: 631d978aea20554414f18bf3, topology_type: ReplicaSetNoPrimary, servers: [<ServerDescription ('ac-qogzmu1-shard-00-00.9qtx1gp.mongodb.net', 27017) server_type: Unknown, rtt: None, error=AutoReconnect('ac-qogzmu1-shard-00-00.9qtx1gp.mongodb.net:27017: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)')>, <ServerDescription ('ac-qogzmu1-shard-00-01.9qtx1gp.mongodb.net', 27017) server_type: Unknown, rtt: None, error=AutoReconnect('ac-qogzmu1-shard-00-01.9qtx1gp.mongodb.net:27017: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)')>, <ServerDescription ('ac-qogzmu1-shard-00-02.9qtx1gp.mongodb.net', 27017) server_type: Unknown, rtt: None, error=AutoReconnect('ac-qogzmu1-shard-00-02.9qtx1gp.mongodb.net:27017: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)')>]> 이러한 에러가 뜹니다. 어떤 유형의 에러일까요? 콘솔 창에는 jquery.min.js:2          POST http://localhost:5000/homework 500 (INTERNAL SERVER ERROR) 이렇게 찍힙니다


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