我正在尝试使用flask连接到基于URL参数的其他数据库
将路线定义为
@app.route('/data_service/file/<string:db>/', methods=['GET','DELETE','POST','PUT'])
def file():
但是,烧瓶抱怨说
TypeError: file() got an unexpected keyword argument 'db'
Imho这应该根据说明进行操作,例如https://pythonprogramming.net/flask-url-converters-tutorial/
答案 0 :(得分:0)
我发现了错误
该参数应该在函数中出现 在这种情况下,代码应该是
@app.route('/data_service/file/<string:db>/', methods=['GET','DELETE','POST','PUT'])
def file():