path:path在路由中的使用
生活随笔
收集整理的這篇文章主要介紹了
path:path在路由中的使用
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
例子如下:
from flask import Flask app = Flask (__name__)@app.route('/client/<path:path>') def send_static(path):""" serves all files from ./client/ to ``/client/<path:path>``:param path: path from api call"""print("path=",path)return "hello World" if __name__ == '__main__':app.run(debug=True)運(yùn)行:
python test.py
?
瀏覽器訪問(wèn):
http://127.0.0.1:5000/client/test
終端會(huì)輸出:
path= test
總結(jié)
以上是生活随笔為你收集整理的path:path在路由中的使用的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: matlab求借带参数的方程组
- 下一篇: class AbstractAPI(me