8646

Pycharm: testing from anther computer in local network

Question:

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" />

Recommend

  • Accessing running Grails application from a remote machine
  • Java SOCKS proxy
  • How do you communicate to a Modbus device within an iPhone application?
  • How can i make a node.js server to listen to my ip on my lan instead of localhost
  • How can I stop sql query execution in php?
  • When using tnsping, can I specify a port number along with the SID?
  • double precision error when converting to scientific notation
  • TCP Ping in Silverlight
  • Tracking screen recorder in windows app
  • python & Mysql: unsupported operand type(s) for -: 'int' and 'tuple'
  • Issue when joining serf nodes located in different Docker containers
  • Google OAuth2 for an web application hosted behind NAT (intranet server without public IP)
  • Bootstrap Popover showing at wrong place upon zoom in/out or resizing Browser window
  • NHibernate proxyexception
  • How to resolve docker host names (/etc/hosts) in containers
  • Creating My Symmetric Key in C#
  • Should I be afraid to use UDP to make a client/server broadcast talk?
  • (Tcl/Expect) clear screen after exit
  • How to implement Deep Linking in Roku SG application?
  • Scanner nextInt() and hasNextInt() problems
  • HttpListener.IsSupported is false on XP SP3
  • jQuery: How to AJAXify WordPress Search?
  • what makes a request a new request in asp.net C#
  • Private IP address in reserved subnet range
  • Thread 1: EXC_BAD_ACCESS (code =1 address = 0x0)
  • Trying to get the char code of ENTER key
  • Specify the x-axis values in ggplot in R
  • Invalid object name 'dbo.Item'
  • Jenkins: FATAL: Could not initialize class hudson.util.ProcessTree$UnixReflection
  • TextToSpeech.setEngineByPackageName() triggers NullPointerException
  • System.InvalidCastException: Specified cast is not valid
  • Installing iPhone App to iPhone
  • Could not find rake using whenever rails
  • Meteor: Do Something On Email Verification Confirmation
  • Read a local file using javascript
  • Cannot resolve symbol 'MyApi'
  • How to get address from latitude and longitude android google map v2 [duplicate]
  • Apache 2.4 and php-fpm does not trigger apache http basic auth for php pages
  • using HTMLImports.whenReady not working in chrome
  • How do you join a server to an Active Directory (domain)?