3일차 github & 404,500 error

LeeJaewon·2022년 11월 2일

git & github
코딩 외에 실무적인 문제를 해결해주는 것
git init 버전관리 시작
git add . (파일,폴더명 입력하면 그것만)
git commit -m ""
git push 허브로 올려보냄
git clone 허브에 있는 걸 컴퓨터에 복사
git pull
git checkout .

오늘은 미니프로젝트에서 개인페이지 작성한 걸 취합해서
메인페이지를 만들어 봤는데

취합한 페이지를 db에 연결하려고 하니 404에러와

500에러가 떴다.

@app.route("/comments", methods=["POST"])
def post_comments():
name_receive = request.form['name_give']
comment_receive = request.form["comment_give"]

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

doc.comments.insert_one(doc)   ----------맨 앞 doc이 부분이 db가 되어있어야 하는데 doc여서 안됐음
return jsonify({'msg': '등록 완료!'})
  1. comments DELETE
    @app.route("/comments/delete", methods=["POST"])
    def delete_comments():
    name_receive = request.form['name_give']
    doc.comments.delete_one({"name": name_receive}) -------같은 이유로 되지 않음
    return jsonify({'msg': '삭제 완료!'})

오늘은 뭔가 알것 같은 느낌이 조금씩 들기 시작했다
내일은 팀원들의 db를 연결해서 get방식으로 보여주는 작업을 할 예정이다
오늘보다는 좀 더 발전했으면 좋겠다

profile
한 걸음 한 걸음 꾸준히

0개의 댓글