
어제 글을 남겼는데 답변이 늦어져서 다시 남깁니다.
현재 문제는 4주차 숙제하기중에 몽고디비에 정보가 넣어져야하는데 전송이되지않습니다.
제가 따로 파이선파일 만들어 넣어봤는데 거기서는 잘 됩니다.
숙제하기 코드스니펫으로 수정해서 하니 디비에 정보가 넣어지지않습니다.
현재 certifi패키지도 설치하고 코드도 추가했는데도 여전히 되지않습니다ㅠ
꼭 해결 부탁드립니다.



from flask import Flask, render_template, request, jsonify
app = Flask(__name__)
from pymongo import MongoClient
import certifi
ca = certifi.where();
client = MongoClient('mongodb+srv://hoisohee:dladnrgus77@cluster0.yfexp.mongodb.net/Cluster0?retryWrites=true&w=majority', tlsCAFile=ca)
db = client.dbsparta
@app.route('/')
def home():
return render_template('index.html')
@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':'응원 완료!'})
@app.route("/homework", methods=["GET"])
def homework_get():
comment_list = list(db.homework.find({},{'_id':False}))
return jsonify({'comments':comment_list})
if __name__ == '__main__':
app.run('0.0.0.0', port=5000, debug=True)
