0

I am using django and everytime I do:

python manage.py runserver

it runs on 127.0.0.1:8000 and it works when I access it from my VM (I am running in on my VM). But on my host OS when I go to 127.0.0.1:8000, it says it cannot connect to it. I tried doing

python manage.py runserver 0.0.0.0:8000

as well and on my host OS, I tried connecting to the VM's IP (192.168.174.233:8000) but it again said I cannot connect to it. What am I doing wrong?

Edit: Host OS is Windows 8 and VM is Lubuntu.

SilentDev
  • 20,997
  • 28
  • 111
  • 214
  • @AamirAdnan host OS is windows 8 and VM is lubuntu. – SilentDev Jun 12 '14 at 23:23
  • Go to terminal and type `ipconfig /all` find `IPv4 Address` e.g. `192.168.1.19(Preferred)` the start your server as `python manage.py runserver 192.168.1.19:8000` – Aamir Rind Jun 12 '14 at 23:24
  • @AamirAdnan it says "Error: That IP Address can't be assigned to"... I tried going to '/etc/network/interfaces' and confirmed that these two lines do exist in the file: 'auto lo' and 'iface lo inet loopback' as suggested in this post: http://stackoverflow.com/questions/13505540/error-that-ip-address-cant-be-assigned-to-in-django – SilentDev Jun 12 '14 at 23:28
  • Check this http://stackoverflow.com/questions/7263884/how-can-i-see-the-django-development-server-in-vmware – Aamir Rind Jun 12 '14 at 23:47
  • To anyone else who has this same issue, the answer is in this post:http://stackoverflow.com/questions/18551658/how-to-access-django-development-server-on-virtual-machine-from-actual-computer/24296578#24296578 – SilentDev Jun 19 '14 at 04:37

1 Answers1

0

not sure if you checked it already but this could be a firewall issue on your Linux machine. for me it works nicely when I run the server like you did with 0.0.0.0:8000 on my Linux vm

to check firewall try

sudo iptables -L

it should look something like this :

Chain INPUT (policy ACCEPT)
target     prot opt source               destination         

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination 
Kerberos
  • 103
  • 1
  • 6