lingthio / Flask-User

Customizable User Authorization & User Management: Register, Confirm, Login, Change username/password, Forgot password and more.
http://flask-user.readthedocs.io/
MIT License
1.06k stars 294 forks source link

new view works when using get method, but doesn't work when using post method with 400 bad request error. #273

Open AM12345678 opened 5 years ago

AM12345678 commented 5 years ago

When I use flask, both get method and post method work very well. but when I change to flask-user 1.0, only the get method work, all the views requested from post method didn't work. What's wrong?

Here are code: in main_views.py:

@main_blueprint.route('/main/test', methods=['GET', 'POST'])
def test_page():
    print("***** request is ", request)
    return redirect(url_for('main.home_page'))

in the html file:

 <form action="/main/test" method="post" id="test">
    <input type="text" class="form-control" name="address">
    <button type="submit" class="btn">Submit</button>
 </form>

If method="get" it worked well, if method="post" then got Bad Request error.

Please help. Thanks.

AM12345678 commented 5 years ago

anybody can help?

Chaostheorie commented 4 years ago

Is this still a problem?