The method is not allowed for the requested URL.

Today, I had an error while working on one of my web app made with Flask. I got this error:

Method Not Allowed The method is not allowed for the requested URL.

The simple solution is to put methods=['GET', 'POST'] in the app route. Like so:

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

It fixed the problem right away. Now, I can continue to work on deploying my machine learning model on the world “wild” web!

Author: Ednalyn C. De Dios

I’ve always been enamored with code and I love data science because of its inherent power to solve real problems. Having grown up in the Philippines, served in the United States Navy, and worked in the nonprofit sector, I am driven to make the world a better place. I have started and participated in numerous campaigns that aim to reduce domestic violence and child abuse in the community.