Reputation:
I've been finding a 405 error when I try to pass a form by POST to a python script using flask.
My Python is like this:
@app.route('/make', methods=['POST', 'GET'])
def make():
if request.method == 'POST':
return "its working"
My form is like this:
<form method="POST" target="/make">
<div id="Question">
</form>
My code is kinda big so I'm not reproducing it entirely. I cant seem to find my mistake. What am I doing wrong?
Upvotes: -1
Views: 1040
Reputation:
In your form you need to use action
instead of target
<form method="POST" action="/make">
<div id="Question">
</form>
more details: form_action
Upvotes: 1