Add Django 1.5, 1.6 support

This avoids the deprecated django.conf.urls.defaults module and works around an issue in newer Django versions adding an extra newline to the output of a command.