Serve Python through the Leopard Firewall

I’m working on a few Django projects now any I’m learning some of the tricks the hard way. Hopefully I can save you some of that pain.

I was recently having some trouble getting any of the browsers in my Windows XP under Parallels to see my local development server running on my Leopard Mac. It would load all of my Apache and Mongrel served apps fine, but it refused to connected to the Django server.

So, to get all these things working together…

  1. Allow incoming connections for Python in the Leopard Firewall
  2. Force the Python Django development server to allow access to other people on your LAN

Allow incoming connections for Python in the Leopard Firewall

  1. Open your System Preferences
  2. Security
  3. Firewall Tab
  4. Select “Set access for specific services and applications”
  5. Click the + icon at the bottom left of the list
  6. ⇧⌘G — Go to folder “/System/Library/Frameworks/Python.framework/Versions/2.5/Resources/”
  7. Select the Python app
  8. Click “Add”
  9. Find Python in the list (just above Quicktime Player for me)
  10. Change the dropdown on the right so show “Allow incoming connections”

Force the Python Django development server to allow access to other people on your LAN

  1. Simply always serve with the ip 0.0.0.0
    python manage.py runserver 0.0.0.0:8000
  2. There is no step 2

Now you’re free to enjoy cross browser testing for your locally served Python Django webapps!
YAY!!!1!