Removed the call to settings.configure(). The Django docs say: "Use exactly one of either configure() or DJANGO_SETTINGS_MODULE. Not both, and not neither." The call to configure() was erasing the contents of settings.DATABASES, which was then causing a KeyError further on. #322