display data in an other device on my network

Posted November 28, 2020 605 views

I can’t access to my backend django data after I run my server with my address IP with command bellow :“python3 runserver”,

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

Hi @isdat,

Please note that is an internal IP address so if you are not in one network trying to reach would not be possible.

The next step would be to allow connection from your droplet to the other droplet on port 1880 via IPtables.

sudo iptables -A INPUT -p tcp -s XXX.XXX.XXX.XXX --dport 8000 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
sudo iptables -A OUTPUT -p tcp --sport 8000 -m conntrack --ctstate ESTABLISHED -j ACCEPT

Please remember to change XXX.XXX.XXX.XXX with the IP address the request is coming from i.e your droplet.