Blog

Posts from June 2010

Automatically Running Supervisord on Startup

Posted by Peter Baumgartner on June 24, 2010. Filed under pro tip, sysadmin

I really like supervisord for long-running process management. It is Python, so it is easy to install and it is easy to script with tools like Fabric. Lately I’ve been deploying smaller Django/WSGI sites with Green Unicorn behind Nginx proxied over a Unix socket which makes for a nice little setup on shared hosting and RAM starved VPSes.

After installing supervisord with something like sudo easy_install supervisor, you’ll want to make sure it runs after you reboot your machine (and gets restarted in case it crashes). If you are on a Linux system with upstart (and have root access), you can bypass the ugly init scripts and use this simple file placed in /etc/init/supervisord.conf to manage your supervisord process:

description     "supervisord"

start on runlevel [2345]
stop on runlevel [!2345]

respawn

exec /usr/local/bin/supervisord --nodaemon --configuration /etc/supervisord.conf 

Now that it is ...

View comments View full post

Django 1.1 Testing and Debugging Book Review

Posted by Peter Baumgartner on June 16, 2010. Filed under django, review

Django 1.1 Testing and Debugging

I just finished reading the copy of Django 1.1 Testing and Debugging by Karen M. Tracey provided to us for review by Packt Publishing. For those of you who don’t know, Karen is a core developer of Django and her knowledge and experience in the framework shines through in this book.

This is a great book for people who want to transition from being a hobbyist tinkering on Django sites to professional developers. It will be a lot to digest for a newcomer to Django and might not contain much new information if you’ve been working with Django for a while (and writing tests for your code). The book covers:

  • doctests vs. unit tests
  • integrating external tools like Nose, Coverage, and Twill
  • debugging with logging, Django Debug Toolbar, and pdb
  • how to get help from the Django community and file bugs
  • troubleshooting Apache/mod_wsgi deployments

Even though ...

View comments View full post