相关疑难解决方法(0)

是否定义了Python烧瓶的路径顺序?

我的观点中有类似下面的设置:

@app.route("/test")
def test():
    ...
@app.route("/<to>")
def page(to):
    ...
Run Code Online (Sandbox Code Playgroud)

在访问"/ test"url时,似乎总是会调用示例中的函数测试.这也是我想要的.但我在文档中找不到这种行为.这样定义的名称总是优先于变量吗?或者是重要的定义的顺序?我能否以任何方式确定优先级,以确保将来不会破坏?

python flask python-2.7

2
推荐指数
1
解决办法
863
查看次数

标签 统计

flask ×1

python ×1

python-2.7 ×1