I understand. OTOH, if you have a custom DJANGO_SETTINGS_MODULE and you don't set the environment variable pointing to it, it will silently use graphite's default paths, which will be wrong, so if you are running this script from cron and upgrade it will silently break.

What I'm proposing is that you check for 'if "DJANGO_SETTINGS_MODULE" in os.environ' as the very first thing in the script, before trying to import from graphite. If it's unset, complain loudly and exit.