try:
    import psycopg2
    HAS_PSYCOPG2 = True
except ImportError:
    psycopg2 = None
    HAS_PSYCOPG2 = False

try:
    from django.contrib.gis.geos.libgeos import geos_version_info
    HAS_GEOS = geos_version_info()['version'] >= '3.3.0'
except (ImportError, OSError):
    HAS_GEOS = False

@@ -1,16 +1,73 @@
+from django.core.exceptions import ImproperlyConfigured%0A%0A
 try:%0A    import 
@@ -321,16 +321,38 @@
  OSError
+, ImproperlyConfigured
 ):%0A    H

fix ImproperlyConfigured