0

I am trying to access a django app in port 8000 of a linux VPS from my local machine.

Port 8000 is already open

public (active)
 target: default
 icmp-block-inversion: no
 interfaces: eth0
 sources: 
 services: cockpit dhcpv6-client ftp http https ssh
 ports: 5432/tcp 8080/tcp **8000/tcp**
 protocols: 
 masquerade: no
 forward-ports: 
 source-ports: 
 icmp-blocks: 
 rich rules: 

I started django server using python3 manage.py runserver 74.208.210.200:8000

and tried to access it in my local machine using my server's public ip address

74.208.210.200:8000

however, the only thing I see is CONNECTION TIME_OUT

the only way I can access this django app in port 8000 is from localhost

If I run netstat -tulnp I see the following:

`tcp 0 0 74.208.210.200:8000 0.0.0.0:* LISTEN 684680/python3 ``

Please help!

  • try python3 manage.py runserver 0.0.0.0:8000 and in allowed_host from settings.py add your local machine ip where is your server is running. you can get your ip using ifconfig command in terminal. – harshil suthar Dec 21 '20 at 11:44
  • Are you sure your server is able to be visible from the outside by this IP:PORT? Often hosting providers are blocking most of the ports. PS: There's no need to add IP to settings.ALLOWED_HOSTS. – SergeiMinaev Dec 24 '20 at 19:10
  • @SergeiMinaev You are right, the problem was that my hosting provider was blocking external connections, so i had to update the firewall options from the hosting website :) – Adrian Gutierrez Dec 25 '20 at 21:00

0 Answers0