Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
sahil jagdale
Courses Plus Student 244 Pointswhen i set up python flask locally , after writing a script when i try to run it on my browser it showed "page error" ,
when i put the address http://0.0.0.0/8000 it showed nothing from my script , then i googled it and found out i should type http://127.0.01:8000/ and it worked . but now my problem is why is that treehouse uses different address for same script and i use different one. ?
1 Answer
Nathan Tallack
22,164 PointsWhen a service starts up and it binds to "all addresses" it shows as running on 0.0.0.0 on your computer. But what it is actually doing is listening to all addresses.
You do not talk to it via the address 0.0.0.0, that is just the address it is "listening" on. So it will answer a request coming into any address when it is listening on 0.0.0.0 as the training shows.
When you talk to your computer, you always talk to it via it's IP address (the one given to you by your router, often starting with 192 or 172 or perhaps even 10) or via the localhost address (127.0.0.1) which will always be valid.
So, you listen on 0.0.0.0 but you talk to your own computer via 127.0.0.1. That being said, of course you can listen on 127.0.0.1 but then you will only be able to connect from your local computer and not from anywhere else on your network. Which is sometimes a good thing for security. ;)