# 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) 이렇게 찍힙니다