I have a django project that I am running on localhost:8000 and that works fine. Now I want it to access from any machine that is connnected to other network.
Doing some google I found that I can do it by setting port forwarding from my router. I have a tplink router and I did the following setting:
Service Port:27015
IP Address: my_ip_address # obtained by ifconfig
Protocol: All
Status: Enabled
Now I run my project with python manage.py my_ip_address:27015
But when I run with my_ip_address:27015
in url from another machine connected to another network I cannot view my site/page
Can anyone help me how to access my localhost outside the globe?
You can not access localhost form outside; localhost servers will only respond on the localhost "device".
you need to start the server, in this case django, and have it bind to your local address (192.168, or 10., etc).
python manage.py runserver 0.0.0.0:8000
will have it bind to all available IP addresses on your machine.
Then you can port forward on your router to your local machine (disable any firewall for that port on your local machine)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With