【发布时间】:2017-04-19 03:34:03
【问题描述】:
我的烧瓶应用程序遇到路由问题。
路由定义如下
@app.route("/<lang>/books/<name>.html")
def func1(lang="en", name="")
pass
@app.route("/<lang>/books/index.html")
def func2(lang="en"):
pass
因此,如果请求像 /en/books/index.html 这样的 url - 它应该路由到第二个函数,但烧瓶将它路由到第一个函数。
为什么会这样??我还通过将上面的 func2 更改为 func1 来更改代码的顺序,但仍然遇到同样的问题,我能知道如何解决它吗?
【问题讨论】: