I develop web applications using Django on Mac OSX 10.6. I use Django's built in local development server which I run on my computer's IP (such as: http://192.168.0.11:8001/). I test my applications in Firefox, Safari and Chrome and all display fine. I use Sun's VirtualBox with 3 different instances of Windows XP that have IE6, IE7 and IE8 on them.
For whatever reason, these sometimes just don't display the Django sites. They come up with 'The page cannot be displayed'. Eight times out of ten, they display fine and function normally but for no reason at all they won't display. Sometimes restarting Django's local development server from the Terminal will fix the problem, sometimes it won't.
Is there some sort of VirtualBox settings or Django settings that I need to set to ensure smooth operation of this? Am I overlooking something? Has anyone else had these problems?
By default the dev server binds to localhost. to run it on all interfaces use ./manage.py runserver 0.0.0.0:8000
I found the best way to do this is using the normal localhost:8000 or localhost:8001 (any port you need, especially if running multiple Django projects at the same time) in the Mac Terminal.
Then in VirtualBox with Windows, using the ipconfig command in the Command Prompt to find out the IP settings. Grab the Default Gateway (mine was 10.0.2.2 for example) then, in the browser, use this as the address to get to your Django project along with the original port setting that was set in the terminal. So in this case: http://10.0.2.2:8000/
I've been running it like this now for almost a week and it seems to of stopped the problems I was getting before totally. I couldn't really tell you why though!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With