Articles

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.

  • The Django development server refuses all connections from any other machine.
  • The Leopard Firewall refuses to allow any other machine to access your Python server.
  • Parallels and VMWare Fusion operating systems run asif they are real machines on your local network.

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!

Related Articles

  • 29 Jul 2009 CSS Position Fixed for IE6
  • 23 Jul 2009 Subtle Hover CSS Inspect Bookmarklet
  • 22 Jun 2009 Replace document.write using MooTools
  • 21 Jun 2009 Testing a way to post to my blog quickly
  • 21 Jun 2009 Jekyll quick post shell script
  • 09 Apr 2009 Blazing fast Semantic JS Templating with edit-in-place templates!
  • 07 Mar 2009 SubtleClickAll Bookmarklet
  • 05 Dec 2008 MooTools databinding plugins coming soon
  • 25 Oct 2008 Tabs or Spaces?
  • 20 Oct 2008 How to have a box default to hidden and then fade it in later
Thomas Aylott Polaroid
SubtleGradient
  • GitHub
  • X (née Twitter)
  • LinkedIn
  • YouTube
  • OpenSea
  • Facebook
  • Blog
  • Email

Thomas Aylott / subtleGradient