How about this?
@app.route("/<lang>/books/<name>.html")def func1(lang="en", name=""): if name == "index": return index() return something_else()