Even though we’d all like to believe that IE is dead and there’s no need to test it any more, that simply isn’t the case yet. But debugging via a remote server is a pain when you can easily use a local Windows VM running on VMware Fusion.
The following will get you up and running with a local Django server (running on port 8000) and any Windows OS. Note that I’m using the latest VMware Fusion (version 6) but the same steps will work with previous versions as well.
First, shutdown the VM (power it off completely) and then open it’s settings. Click Add Device, select Network Adapter and click Add.
Now you’ll see 2 network adapters for the VM. Click the new one to edit it.
Switch the connection type to Private to my Mac.
Next, grab the IP address your Mac is using for this private network. Open a terminal window and run “ifconfig vmnet1”.
$ ifconfig vmnet1
vmnet1: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
inet 172.16.85.1 netmask 0xffffff00 broadcast 172.16.85.255
The last line is the important one. Make note of the IP address next to inet, in this case mine is 172.16.85.1. Because we made a new private network, this IP should hopefully stay the same and you won’t have to worry about messing with the configuration again down the road.
Next, start your Django server using the IP address 0.0.0.0:
$ python manage.py runserver 0.0.0.0:8000
Now start the VM back up and open up IE or your browser of choice. Go to http://172.16.85.1:8000 (make sure to substitute the IP address you made note of above). Voilà, you’re browsing your local Django server from Windows.
If you’d like to use something more memorable for the host name, go ahead and edit the Windows host file (it can be found here – C:\Windows\system32\drivers\etc\hosts). Add the new host to the list of entries:
I found that xxxx.local worked reliably while other host names were hit and miss.
Finally, flush the DNS on your VM for the host changes to take effect:
You can now reach your Django site at http://mysite.local:8000.