Ask coding questions

← Back to all posts
Flask routing not working
Chaoyue123

A similar question is posted here:
https://stackoverflow.com/questions/67524800/flask-redirect-not-working-at-all-on-repl-it

Here's the code:

However, when I tried to add '/hello' to the website link, it gives me a 404 not found error.

Answered by VulcanWM [earned 5 cycles]
View Answer
Voters
Chaoyue123
Comments
hotnewtop
VulcanWM

Move the hello route above app.run
You’re defining the hello route after the app running so it doesn’t show

Chaoyue123

@VulcanWM
So it was such a simple mistake 😳
Thanks for replying so quickly

VulcanWM

yeah lmao sometimes you just don't get what's happening but when someone tells you your mistake you're like "why didn't i think of that"
np! @Chaoyue123