0
votes

How do I access an app running on django dev server(ubuntu 15.10) from another machine on the same network(eg. a windows 7) ? I am able to ping this machine from another network computer.

"python manage.py runserver 0.0.0.0:8000" - does not allow me to access the app from another network computer.

app uses django 1.5.9

2
That is exactly what you do. What address are you putting in on the other computer? What do you see when you try?Daniel Roseman
can you try port 80?Anurag Joshi

2 Answers

0
votes

https://docs.djangoproject.com/en/1.8/ref/django-admin/#django-admin-runserver

Note that the default IP address, 127.0.0.1, is not accessible from other machines on your network. To make your development server viewable to other machines on the network, use its own IP address (e.g. 192.168.2.1) or 0.0.0.0 or :: (with IPv6 enabled).

runserver 0.0.0.0:8000

Make sure you open port 8000

0
votes
python manage.py runserver 0.0.0.0:8000

is ok but you have to also modify settings.py of your app. You need to change ALLOWED_HOSTS. For example put * to allow access for everybody or put only certain IPs to limit access:

ALLOWED_HOSTS = ['*']

more answers here: CommandError: You must set settings.ALLOWED_HOSTS if DEBUG is False