Access Python Development Server from External IP

tomato picture tomato · Feb 14, 2011 · Viewed 12.8k times · Source

I am learning Django and have deployed apps on my iMac locally. I want to show the apps from external IPs over the internet. I did add an exception to the firewall for port 8000, and ran the python dev server over 8000. Able to access at localhost, but not over the net. However, when I tried XAMPP (Apache) over the same port 8000, I can access the site externally, despite needing to change the httpd-xampp.conf file. Is there a similar file for the python server? How can I access the dev server from external IP's?

Environment: Mac OSX 10.5.8, Python 2.5, Django 1.2.5

Thanks in advance!

Answer

Uku Loskit picture Uku Loskit · Feb 14, 2011
python manage.py runserver 0.0.0.0:8000

This will make it listen to any address. Quite useful when you want to develop over ssh from a machine that you cannot install stuff on.