Tornado POST method error 405

I am trying to php login in a tornado and when I click Login I get a 405 Method not allowed error page.

Here is my form:

<form method="POST">

          <fieldset id="inputs">
            <input name="username" id="username" required>   
            <input name="password" id="password" type="password" name="Password" placeholder="Password" required>
          </fieldset>
          <fieldset id="actions">
            <input type="submit" id="submit" value="Log in" name="submit">
            <label><input type="checkbox" checked="checked"> Keep me signed in</label>
          </fieldset>

        </form>

      

+3


source to share


1 answer


You need to add an action to your form and use the post method in your handler. If you set up a handler like:

(r"/feedback", FeedbackHandler)

      

Who has a post method:

def post(self):
    #do something here

      



And a form that has:

<form action="/feedback" method="post" >

      

It should work.

+1


source







All Articles