Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tornado 405 error POST method not allowed

I am trying to make a php login into tornado and when I click "Sign in" I am getting a page with an error saying "405 Method not allowed".

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>
like image 777
geotsak Avatar asked Aug 10 '26 21:08

geotsak


1 Answers

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

(r"/feedback", FeedbackHandler)

Which has a post method:

def post(self):
    #do something here

And a form which has:

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

It should work.

like image 65
Noelkd Avatar answered Aug 13 '26 10:08

Noelkd



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!