Tales of a GeekTrotter Binary Logbook

4Feb/120

Run Django from a VM and access it from the host

If you try to run Django development mode from a Virtual Machine and access the website from the host, you need to specify the global IP address in the "runserver" command.

For example if your VM IP address is 192.168.31.128 (in NAT mode):
IP_address_of_the_VM

You should run the server by calling (you can change the port):

python manage.py runserver 192.168.31.128:8000

Run_server_from_VM

Now you need to connect to the website specifying the IP address like that: http://192.168.31.128:8000.

Both from the VM:
Access_server_in_VM

And the Host:
Access_server_from_host

The server running on Linux is much faster than the one running on Windows :)