0

Something wrong. 2 months ago I was able to access my django server to this url/port

http://212.47.245.79:8000/

Yesterday I went back to this machine, as connection was down. I have restarted django, and I got ERR_CONNECTION_REFUSED in my browser

With netstat -tulpn | grep LISTEN I can see the port 8000 is in LISTEN mode.

What could be the cause ?

Thanks

fransua
  • 111
  • 3

1 Answers1

1

Judging from netstat output you provided, the process is listening on localhost interface only:

tcp 0 0 >>127.0.0.1:8000<< 0.0.0.0:* LISTEN 260163/python

It means that you'll be able to connect to the port locally but any external connection will result in "Connection refused".

It's really hard to answer why it happened, possibly a configuration change or maybe some update messed things up. You need to review your configuration and make sure the process is listening on '0.0.0.0:8000' or maybe just one specific interface.

For example launching in CLI like this will cause listening on localhost only:

python manage.py runserver 127.0.0.1:8000

To make it listen on all interfaces you would need to launch it like this:

python manage.py runserver 0.0.0.0:8000

Hope this helps.