I am using Pycharm and testing on local dev server. All goes well until I try to connect to the local dev server from another laptop (windows).
My dev server is
127.0.0.1:8000 on a mac. On the second computer, I am able to ping the server's LAN ip
10.0.2.2 successfully. But enter
10.0.2.2:8000 in browser address bar doesn't connect to anything.
telnet 10.0.2.2 8000 in command line also fails.
How can I do this?Answer1:
Listen to address 0.0.0.0 instead of 127.0.0.1 This means it will listen to all, you can listen to specific IP but this would work on both local and network.Answer2:
For beginner like me, screenshot can help.
If leaving Host field to be empty, it will default to 127.0.0.1, which is not we want in such situation.
<img alt="enter image description here" class="b-lazy" data-src="https://i.stack.imgur.com/yyTMJ.png" data-original="https://i.stack.imgur.com/yyTMJ.png" src="https://etrip.eimg.top/images/2019/05/07/timg.gif" />