Python Flask Code is Not working
Why is my python flask code not working? It keeps leading me to this site saying my website refused to connect
lol np :) @PlaySoccer
Hey there! So this is a pretty common problem, you need a port if you want the flask to open, so copy this code on line 8:
app.run(host='0.0.0.0', port=8080)
Seems many people experience this annoying issue, follow my shortcut here:
1. Open a new repl, then press the examples button:
2. Press the first example, it is called Flask (server):
So there you go, a much simpler shortcut!
Hope this helped and have fun coding :)
@PlaySoccer Not even a thank you?!? :(
Oh sorry @JosehSanthosh. I didn't see your comment.
I always need to refresh the page when I click my notifications. I just forgot to do it when I saw that @Coder100 replied to my post. I did not want to be rude @JosephSantosh
Oh, I'm so sorry for making it seem that way! Well thx for telling me! :) @PlaySoccer
I tried this, and I'm still getting the same issue. Is this something that is beyond my control? (I'm on the school wifi, for context).
Repl.it only hosts when your IP is
0.0.0.0
.So replace your code in line
9-10
:That's it! Easy, right?