This is not Python 3 compatible; needs to use ``except ImproperlyConfigured as e`` instead.