title: Connection refused on Windows XP network
body: <p>This is only marginally a programming problem and more of a networking problem.</p>
  
  <p>I'm trying to get a Django web app to run in my home network and I can't get any machines on the network to get to the web page. I've run on ports 80 and 8000 with no luck. Error message is: "Firefox can't establish a connection to the server at 192.168.x.x." </p>
  
  <p>I've tried using sockets in python from the client:</p>
  
  <pre><code>import socket
  s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  s.connect ( ("192.168.x.x", 80) )
  </code></pre>
  
  <p>I just get "socket.error (10061, 'Connection refused')". Interestingly, I can connect with port 25.</p>
  
  <p>There is no Windows firewall running. There is a NetGear router/firewall in front of the cable modem.</p>
  
  <p>What should I be looking at to configure this?</p>
  
  <hr>
  
  <p>Also tried:</p>
  
  <pre><code>import urllib2
  urllib2.urlopen("http://192.168.x.x/")
  </code></pre>
  
  <p>Same thing.</p>
  
  <hr>
  
  <p>Re: "Can you see the Django app from the machine it's running on?"</p>
  
  <p>Yes. It does work on the same machine. It does not work across the network.</p>
  
  <p>I can also set the server to run on whatever port I choose (80, 8000, etc.) and it is accessible locally, not across the network.</p>
  
  <hr>
  
  <p>Q. Is it netstat-able?
  A. Yes:</p>
  
  <pre><code>  Proto  Local Address          Foreign Address        State
    ....
    TCP    D3FL2J71:http          localhost:1140         TIME_WAIT
    TCP    D3FL2J71:http          localhost:1147         TIME_WAIT
  </code></pre>
  
  <p>I have the website visible in two browser windows locally.</p>
  
  <hr>
  
  <p>Use explicit external port (not rely on localhost):</p>
  
  <pre><code>python manage.py runserver 192.168.x.x:8000
  </code></pre>
  
  <p>Bing bing bing! We have a winner!</p>
  
  <p>Wow, am I ever glad this is not a networking problem.</p>
  
  <hr>
  
  <p>"is the Django app definitely advertising itself on the 192.168.x.x address and not just on the loopback adapter?"</p>
  
  <p>It seems Jon was on the right track, too, but the comment did not point me in the direction to look -- check the Django server's setup call.</p>