Need to catch `ImproperlyConfigured` to be freed from the schackles of `DJANGO_SETTINGS_MODULE`.
This commit is contained in:
parent
ab8c970368
commit
950e6183c6
|
@ -7,7 +7,7 @@ from ctypes import c_char_p, c_int, CDLL, CFUNCTYPE
|
|||
from ctypes.util import find_library
|
||||
|
||||
from django.contrib.gis.gdal.error import OGRException
|
||||
|
||||
from django.core.exceptions import ImproperlyConfigured
|
||||
|
||||
logger = logging.getLogger('django.contrib.gis')
|
||||
|
||||
|
@ -15,7 +15,8 @@ logger = logging.getLogger('django.contrib.gis')
|
|||
try:
|
||||
from django.conf import settings
|
||||
lib_path = settings.GDAL_LIBRARY_PATH
|
||||
except (AttributeError, EnvironmentError, ImportError):
|
||||
except (AttributeError, EnvironmentError,
|
||||
ImportError, ImproperlyConfigured):
|
||||
lib_path = None
|
||||
|
||||
if lib_path:
|
||||
|
|
|
@ -13,7 +13,7 @@ from ctypes import c_char_p, Structure, CDLL, CFUNCTYPE, POINTER
|
|||
from ctypes.util import find_library
|
||||
|
||||
from django.contrib.gis.geos.error import GEOSException
|
||||
|
||||
from django.core.exceptions import ImproperlyConfigured
|
||||
|
||||
logger = logging.getLogger('django.contrib.gis')
|
||||
|
||||
|
@ -21,7 +21,8 @@ logger = logging.getLogger('django.contrib.gis')
|
|||
try:
|
||||
from django.conf import settings
|
||||
lib_path = settings.GEOS_LIBRARY_PATH
|
||||
except (AttributeError, EnvironmentError, ImportError):
|
||||
except (AttributeError, EnvironmentError,
|
||||
ImportError, ImproperlyConfigured):
|
||||
lib_path = None
|
||||
|
||||
# Setting the appropriate names for the GEOS-C library.
|
||||
|
|
Loading…
Reference in New Issue