I am using django for my project. Now I want to access my project. Both my system and the another one are in the same private network. I am using VPN to connect to the network. How can I access http://localhost:8000 from another system?
What all I did:
ALLOWED_HOSTS = ['*']
DEBUG = False
python manage.py runserver 0.0.0.0:8000
My main motive is to launch the application and to be able to use it from a system - both server and client machine are in same private network connected either by VPN or LAN
Use IP with port number - 192.168.xy: port
. It should work.
If not, check your application is listening on the port using command lsof -i
on your application machine.
mention your ip in ALLOWED_HOSTS in settings.py file like: ALLOWED_HOSTS=['192.168.x.y','localhost']
then run:
python manage.py runserver 0.0.0.0:portnumber
then you can access your ip at any local machine
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.