
from flask import Flask
app = Flask(__name__)
@app.route('/')
def home():
return 'This is Home!'
if __name__ == '__main__':
app.run('0.0.0.0',port=5000,debug=True)
위와 같이 코드를 작성하고 터미널을 실행한 결과 5000번 포트를 이미 사용하고 있다고 출력됩니다.
터미널 출력 결과입니다.
해결 방법이 있을까요?
/Users/seojiyeong/sparta/porjects/prac/venv/bin/python /Users/seojiyeong/sparta/porjects/prac/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.
