Flask page doesn't open, or returns nothing
- Flask
- Raspberry Pi
You may see
Stay safe: Use it on your home network only, and switch off debug mode there.
Why it happens
hostisn't set, so only this computer can open it.- Another copy is still running.
- The function has no
return. - The firewall blocks it.
How to fix it
- Use
app.run(host="0.0.0.0", port=5000). - Open
http://<the computer's IP>:5000from the phone on the same Wi-Fi. - Stop the old copy with Ctrl+C, or use another port.
- End each view function with
return.
It worked if: The terminal prints a line with 200 when you open the page.
Related errors
Tutorials where it can happen
Seen in a real run (some lines are close variants of it). The TypeError came from Flask 3.1.2 here; the others are Flask's usual wording. Sources: Flask: quickstart.
Didn't help? Search another error or ask us.

