Question

display data in an other device on my network

Posted November 28, 2020 506 views
DjangoJavaScriptReact

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

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 192.168.1.6 is an internal IP address so if you are not in one network trying to reach 192.168.1.6 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.

Regards,
KFSys