
* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.
* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.
아틀라스에서 region을 서울로 선택해서 그런 걸까요, 연결이 안 돼요.
앞서 인증 문제 해결 방법 알려주신 대로 설정했었어요.
localhost에서 연결을 거부했습니다.
다음 방법을 시도해 보세요.
ERR_CONNECTION_REFUSED
새로고침
세부정보 숨기기
인터넷 연결을 확인하세요.
케이블을 확인하고 사용 중인 라우터, 모뎀 또는 기타 네트워크 기기를 재부팅하시기 바랍니다.
Chrome이 방화벽이나 백신 프로그램이 설정된 네트워크에 액세스할 수 있도록 허용합니다.
이미 네트워크 액세스가 허용된 프로그램으로 되어 있는 경우 목록에서 삭제한 뒤 다시 추가합니다.
프록시 서버를 사용하는 경우
프록시 설정을 확인하거나 네트워크 관리자에게 문의하여 프록시 서버가 작동하는지 확인하세요. 프록시 서버를 사용하지 않으려면 다음 단계를 따르세요. Chrome 메뉴 > 설정 > 고급 설정 표시 > 프록시 설정 변경… > LAN 설정으로 이동하여 '사용자 LAN에 프록시 서버 사용'을 선택 취소합니다.보고 계신 화면 전체를 캡처해 주시면, 튜터님들이 빠르게 상황을 이해할 수 있어요.
작성한 코드 및 에러 메세지
from flask import Flask, render_template, request, jsonify
app = Flask(__name__)
from pymongo import MongoClient
import certifi
ca = certifi.where()
client = MongoClient("mongodb+srv://test:sparta@cluster0.xgfehcw.mongodb.net/?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)
오류 발생 시, 작성한 코드 전체와 에러 메시지를 첨부해 주세요.
C:\Users\Leina\Desktop\sparta\projects\mars\venv\Scripts\python.exe C:\Users\Leina\Desktop\sparta\projects\mars\app.py
Traceback (most recent call last):
File "C:\Users\Leina\Desktop\sparta\projects\mars\app.py", line 5, in <module>
import certifi
ModuleNotFoundError: No module named 'certifi'
종료 코드 1(으)로 완료된 프로세스
Tip 1) </> 아이콘을 눌러 코드박스를 만들어 보세요.
Tip 2) Ctrl+A(맥의 경우 Command+A) 단축키로 코드를 한 번에 선택할 수 있어요!
