Skip to content
← Back to Community
405 Method not allowed error with flask_wtf
Profile icon
isaiah08

I am re-writing this post because i didn't phrase it correctly the first time. Try running the program, entering test as the username and pass as the password, and you get a 405 error. How can i fix this?

Voters
Profile icon
isaiah08
Comments
hotnewtop
Profile icon
Coder100

hmmm try making sure that the quick form is posting to the correct URL endpoint. It is currently posting to /, and you didn't specify a handler for a post request to that

Profile icon
isaiah08

Thanks! One more question: when you go to /posts, it gives you a 500 error. What is wrong now? @Coder100

Profile icon
Coder100

make sure you actually return something like return 'done!' @isaiah08

Profile icon
Coder100

oh wait nvm sorry @isaiah08

Profile icon
Coder100

so like something like this:

@app.route('/empty-view/') def empty_view(self): content = {'please move along': 'nothing to see here'} return content, 405

is that what you want?

Profile icon
Coder100
Profile icon
isaiah08

That's not what i want, thanks! I rewrote the post, read it again. @Coder100

Profile icon
Coder100
Profile icon
Whippingdot

Wait both of you, bro @Coder100 you are on the project. You don't even have to answer here. This is for our project, and it is for the suggestions page. @isaiah08 was just asking cause no-one was finishing it. Come to the repl here or here. The first one is staging. and the second is normal. Quickly make the suggestions page work both of you, we only have 2 days left. Use python or whatever to make it work. Send the output to a txt file.

Profile icon
isaiah08

Umm... this is not for the repl.it 2020 site. This is flask, and on the 2020 site we are using node.js. This is another thing that i am working [email protected]