This script uses django.conf, and expects settings to be configured. Why isn't it just a management command?