18
votes

I'm trying to make a request to the following view. However, I get the error TypeError: echoplaca() got an unexpected keyword argument 'placa'.

@app.route(r'/enviaplaca/<placa>')
def echoplaca():
    return "Numero de placa: {}".format(placa)
1

1 Answers

38
votes

You defined the route to be /enviaplaca/<placa>, but you defined the view function without the placa argument. The URL captures need to match the function arguments.

@app.route('/echoplaca/<placa>')
def echoplaca(placa):