django accessing localhost from any machine connected to any network

为君一笑 提交于 2019-12-05 21:02:01

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)

Here's what I did..

My configuration was correct. To access from outside the world I just binded my isp ip address with my router port that I forwarded and to open I did

my_isp_ip_address:27015

and it work like a charm

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!