커뮤니티
포인트
쿠폰
내 강의실
국비 신청 내역
증명서
계정
로그아웃
학습 질문
개발 일지
나의 활동
답변 완료
파이참 재 실행 후 서버 연결이 안됩니다
undefined주차
북마크
권*민
댓글
3
추천
0
조회수
4
조회수
4
답변 완료


airplay 수신모드는 꺼있습니다 맥 사용중입니다



스파르타 즉문즉답




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.62cdhto.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)



/Users/9mean2/Desktop/Sparta/projects/mars/venv/bin/python /Users/9mean2/Desktop/Sparta/projects/mars/app.py 

 * Serving Flask app 'app'

 * Debug mode: on

Address already in use

Port 5000 is in use by another program. Either identify and stop that program, or start the server with a different port.

On macOS, try disabling the 'AirPlay Receiver' service from System Preferences -> Sharing.


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


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