2017-05-31 6 views

答えて

0

はい、そうです。あなたのURL docsから

@app.route('/users/', defaults={'page': 1}) 
@app.route('/users/page/<int:page>') 
def show_users(page): 
    pass 

defaultのparamsを渡すことができ@route decorator

0

のための例を見てください。したがって、あなたの場合、pageルートは柔軟なパラメータになる可能性があります。

0

あなたはあなたのルートのメソッドを定義し、そのようにフラスコ内のデータを扱うことができます。

@app.route('/myModel/<location>/getValue', methods = ['POST']) 
def my_route(location): 
    request_location = location # will contain location 
    request_data = request.form # will contain data from request 
    # rest of the code goes here 
関連する問題