Import ImproperlyConfigured exception before use