@app.route(‘/hello‘)
@app.route('/user/<username>')
def show_user_profile(username):
return 'User %s' % username
我们可以采用<converter:variable_name>
对参数进行格式转换(过滤),常用的转换器包括:
int | 整数 |
float | 浮点数 |
path | 包含斜杠的字符串 |
原文:https://www.cnblogs.com/lokvahkoor/p/10505514.html