Skip to content Skip to sidebar Skip to footer

Tornado Url And Html Form

I'm using tornado and I want to Insert something to my MongoDB from values in a HTML form. in the HTML file I have a form like this:
with 2 textbox and

Solution 1:

Change the form method to POST as you are handling in a POST request:

<formmethod="POST" >

You also need to provide an action if the form is served from different page, so your form should be:

<formmethod="POST"action="/admin/edit">

Solution 2:

Your post method isn't called because your form specifies method="get". Change that to method="post" and it'll probably work.

If the action is empty the browser will submit the request to the current page, so if you have a get handler serving the form at the same URL you don't need to specify it.

Post a Comment for "Tornado Url And Html Form"