Search code examples
pythongoogle-app-enginepython-2.7webapp2

Does webapp2 provide some mechanism to invoke DELETE and PUT actions form html forms


Given the following routes:

Route(r'/app/product/<id:\d+>', handler='app.handlers.ProductHandler:show', 
methods=['GET'], name='show-product'), 
Route(r'/app/product/<id:\d+>', 
handler='app.handlers.ProductHandler:delete', methods=['DELETE'], 
name='delete-product'), 

and the following form:

<form action="{{ uri_for('delete-product', id=product.key.id()) }}" 
method="DELETE"> 

Submitting this form is picked up by show-product route.

DELETE and PUT actions are not supported by most browsers, but many web frameworks support some magic to support them anyway. E.g. providing a hidden _method param.

Does webapp2 has something to support DELETE and PUT actions out of the box?


Solution

  • webapp2 can receive this methods, but no any magic to support this params in browsers.