flask URL值 (flask 2)

2019-08-13 14:34:05 浏览数 (1)

from flask import Flask

app = Flask(name)

@app.route('/hi/<int:year>') @app.route('/hello',methods=['GET','POST']) @app.route('/',defaults={"name":"abc"}) @app.route('/<name>') def hello_world(name): return 'Hello World!{}'.format(name)

if name == 'main': app.run( host='0.0.0.0', port=8888, debug=True )

URL转换:

string int float path any uuid

0 人点赞