03. Flask / D-03
1. Variable Rule from flask import Flask app = Flask(__name__) from markupsafe import escape @app.route('/user/') def show_user_profile(username): # show the user profile for that user return f'User {escape(username)}' @app.route('/post/') # post_id 값을 정수형으로만 받는 옵션 def show_post(post_id): # show the post with the given id, the id is an integer return f'Post {post_id}' @app.route('/path/') # path..
IT/파이썬-Flask
2022. 7. 21. 17:33