Method Not Allowed flask error 405

This is because you only allow POST requests when defining your route.

When you visit /registrazione in your browser, it will do a GET request first. Only once you submit the form your browser will do a POST. So for a self-submitting form like yours, you need to handle both.

Using

@app.route('/registrazione', methods=['GET', 'POST']) 

should work.

Leave a Comment