커뮤니티
포인트
쿠폰
내 강의실
국비 신청 내역
증명서
계정
로그아웃
학습 질문
개발 일지
나의 활동
답변 완료
웹 실행 에러 문의
undefined주차
북마크
류*영
댓글
6
추천
0
조회수
10
조회수
10
답변 완료

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

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



18라인의 bucket_give 코드가 문제가 있는 것으로 보이는데

어떤 에러인지 오타인것으로는 확인이 안됩니다 답변 부탁드립니다. ㅠㅠ app.py 코드올립니다


스파르타 즉문즉답







from flask import Flask, render_template, request, jsonify

app = Flask(__name__)


from pymongo import MongoClient

import certifi


ca = certifi.where()

client = MongoClient('mongodb://1sparta:test@ac-j2cpxd6-shard-00-00.pyhzwix.mongodb.net:27017,ac-j2cpxd6-shard-00-01.pyhzwix.mongodb.net:27017,ac-j2cpxd6-shard-00-02.pyhzwix.mongodb.net:27017/?ssl=true&replicaSet=atlas-2769jq-shard-0&authSource=admin&retryWrites=true&w=majority', tlsCAFile=ca)

db = client.dbsparta



@app.route('/')

def home():

return render_template('index.html')


@app.route("/bucket", methods=["POST"])

def bucket_post():

bucket_receive = request.form['bucket_give']

doc = {

'bucket':bucket_receive

}

db.bucket.insert_one(doc)

return jsonify({'msg': '저장완료!'})

@app.route("/bucket", methods=["GET"])

def bucket_get():

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


if __name__ == '__main__':

app.run('0.0.0.0', port=5000, debug=True)



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