Accessing Django Runserver across a network

Here is a simple trick which I have found immensely useful when it comes to browser comparability testing. Basically, I want to run my django development server on one machine (in my case a linux box) and then connect using a different machine (say, running MS Windows with IE).

I have done this before with apache and php projects, but when I tried with my.ip:8000 from another machine I just got my apache welcome page. The trick I found here, was to first stop apache like so:

$ sudo /etc/init.d/apache2 stop

Then start the django runserver on port 80 like so:

$ sudo python manage.py runserver 0.0.0.0:80

And viola! I can connect to the development server using my.ip:80 and test browser compatibility easily – as long as I have the relevant OS/ browser lying around on another machine.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s