커뮤니티
포인트
쿠폰
내 강의실
국비 신청 내역
증명서
계정
로그아웃
학습 질문
개발 일지
나의 활동
답변 완료
certifi 를 못찾겠다고 뜨는데요...
undefined주차
북마크
김*리
댓글
14
추천
0
조회수
23
조회수
23
답변 완료
from flask import Flask, render_template, request, jsonify
app = Flask(__name__)

from pymongo import MongoClient

ca = certifi.where()
client = MongoClient('mongodb+srv://test:sparta@cluster0.ssg19m6.mongodb.net/Cluster0?retryWrites=true&w=majority', tlsCAFile=ca)
db = client.dbsparta


@app.route('/')
def home():
    return render_template('index.html')

@app.route("/mars", methods=["POST"])
def web_mars_post():
    name_receive = request.form['name_give']
    address_receive = request.form['address_give']
    size_receive = request.form['size_give']

    doc ={
        'name':name_receive
        'address':address_receive
        'size': size_receive
    }
    db.mars.insert_one(doc)





    return jsonify({'msg': '주문완료!'}

@app.route("/mars", methods=["GET"])
def web_mars_get():
    return jsonify({'msg': 'GET 연결 완료!'})

if __name__ == '__main__':
    app.run('0.0.0.0', port=5000, debug=True)

 * Detected change in 'C:\\Users\\joon\\Desktop\\sparta\\projects\\mars\\app.py', reloading

 * Restarting with stat

 * Debugger is active!

 * Debugger PIN: 221-171-088

 * Detected change in 'C:\\Users\\joon\\Desktop\\sparta\\projects\\mars\\app.py', reloading

 * Restarting with stat

 * Debugger is active!

 * Debugger PIN: 221-171-088

 * Detected change in 'C:\\Users\\joon\\Desktop\\sparta\\projects\\mars\\app.py', reloading

 * Restarting with stat

 * Debugger is active!

 * Debugger PIN: 221-171-088

 * Detected change in 'C:\\Users\\joon\\Desktop\\sparta\\projects\\mars\\app.py', reloading

 * Restarting with stat

Traceback (most recent call last):

 File "C:\Users\joon\Desktop\sparta\projects\mars\app.py", line 6, in <module>

  ca = certifi.where()

NameError: name 'certifi' is not defined


종료 코드 1(으)로 완료된 프로세스



제가 3주차 데이터베이스 할때 계속 오류가 나서 이번에는 미리 certifi깔고 시작했는데 오류라고 떠서요..

빼야하나요?



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