from flask import Flask
app = Flask(name)
@app.route('/')
def home():
return 'This is Home!'
@app.route('/mypage')
def home():
return 'This is Mypage!'
if name == 'main':
app.run('0.0.0.0',port=5000,debug=True)
플라스크로 서버 두 개만들다가 발생한 오류
AssertionError: View function mapping is overwriting an existing endpoint function: home
home이라는 함수를 두번 사용. 두 번째 home을 다르게 바꿔주면 됨. 복붙할때 유의 하기