我是靠谱客的博主 大胆铅笔,这篇文章主要介绍"path:path"在路由中的使用,现在分享给大家,希望可以做个参考。

例子如下:

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)

运行:

python test.py

 

浏览器访问:

http://127.0.0.1:5000/client/test

终端会输出:

path= test

最后

以上就是大胆铅笔最近收集整理的关于"path:path"在路由中的使用的全部内容,更多相关"path:path"在路由中内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(57)

评论列表共有 0 条评论

立即
投稿
返回
顶部