티스토리 뷰
from flask import Flask
app = Flask(__name__)
@app.route('/')
@app.route('/home')
def home():
return 'Hello, world from Bilient'
@app.route('/user')
def user():
return "This is user-page"
@app.route('/user/<user_name>/<int:user_id>')
def user2(user_name, user_id):
return f'Welcome {user_name}({user_id})'
if __name__=="__main__":
app.run(host='0.0.0.0', port=3771, debug=True)
http:// 123.56.7.8 :3771/user/aa1/1357 | http:// 123.56.7.8 :3771/user |
![]() |
![]() |
http://123.56.7.8:3771/user/aa1 | http:// 123.56.7.8 :3771/user/aa1/bb1 |
![]() |
![]() |
<converter : variable_name> |
* converter types - String - int - float - path - uuid |
반응형
'SWDesk > Web' 카테고리의 다른 글
[Flask in Python - 006] HTML Templates (0) | 2024.02.06 |
---|---|
[Flask in Python - 005] HTML Rendering (2) | 2024.02.06 |
[Flask in Python - 003] Connecting a webpage (0) | 2024.02.06 |
[Flask in Python - 002] Access from Remote Client (0) | 2024.02.06 |
[Flask in Python - 001] Basic Code (0) | 2024.02.05 |
반응형
250x250
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- 둎
- badp
- Innovation&Hurdles
- 혁신과허들
- BSC
- 전압
- Hurdles
- 아두이노
- arduino
- 티스토리챌린지
- 심심풀이치매방지기
- Innovations&Hurdles
- 치매방지
- 전압전류모니터링
- 허들
- Video
- ServantClock
- DYOV
- 빌리언트
- 치매
- 절연형
- 전류
- 혁신
- Innovations
- bilient
- 오블완
- image
- 심심풀이
- Decorator
- 배프
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
글 보관함