커뮤니티
포인트
로딩중
쿠폰
내 강의실
국비 신청 내역
수강권
증명서
숙제 피드백
계정
로그아웃
학습 질문
개발 일지
나의 활동
답변 완료
localhost:5000/mypage 오류
웹개발 종합반
4주차
북마크
김*원
댓글
6
추천
0
조회수
127
조회수
127
답변 완료

localhost:5000은 접속이 되는데

localhost:5000/mypage 는 Not found로 뜹니다 ㅠ


코드


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)

@app.route('/mypage')
def mypage():
   return 'This is Mypage!!!'


결과 값

C:\Users\user\Desktop\sparta\projects\prac\venv\Scripts\python.exe C:/Users/user/Desktop/sparta/projects/prac/app.py 

 * Serving Flask app 'app'

 * Debug mode: on

WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.

 * Running on all addresses (0.0.0.0)

 * Running on http://127.0.0.1:5000

 * Running on http://192.168.0.102:5000

Press CTRL+C to quit

 * Restarting with stat

 * Debugger is active!

 * Debugger PIN: 487-218-095

127.0.0.1 - - [15/Aug/2022 09:19:18] "GET / HTTP/1.1" 200 -

127.0.0.1 - - [15/Aug/2022 09:19:24] "GET /mypage HTTP/1.1" 404 -


스파르타 즉문즉답




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