Reputation: 163
Now that I have created a website, I wish the users can connect to my website within a local network. However my website now can only be accessible from the localhost (my pc), the others are not able to connect to my website when typing my ip address for example xxx.xxx.xxx.xxx:8000 on their browser. I launch the service on my localhost using # python manage.py runserver. May I know if there is a way/command to allow the others to connect to my website?
Note: I have tried # python manage.py runserver 0.0.0.0:8000 as well, which allow all incoming, but it didn't work.
Upvotes: 4
Views: 5463
Reputation: 1
There are steps to resolve this problem are:
1. Use http://<your ip address>
than https
2. Then in settings.py write
ALLOWED_HOSTS = ['*']
3. Finally ran the server with:
python manage.py runserver 0.0.0.0:8000
Upvotes: 0
Reputation: 1415
In settings.py
write
ALLOWED_HOSTS = ['*']
and run python manage.py runserver
0.0.0.0:8000
Note: you can use any port
instead of 8000
Upvotes: 9