diff options
| author | Carl Meyer <carl@oddbird.net> | 2014-11-19 19:10:46 -0700 |
|---|---|---|
| committer | Carl Meyer <carl@oddbird.net> | 2014-11-19 19:23:13 -0700 |
| commit | d2bcb0598058dd93eac94bdbb7dd2565cff0abea (patch) | |
| tree | 5c032ae0f9de000f13cf262a27944ae22cd10e6f | |
| parent | ab2819aa7b09d36d9ff24830a9825aa52b87fdb4 (diff) | |
Fixed #23873 -- Improved GIS error message when GEOS is not installed.
Thanks Claude for writing the patch.
| -rw-r--r-- | django/contrib/gis/db/models/__init__.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/django/contrib/gis/db/models/__init__.py b/django/contrib/gis/db/models/__init__.py index 835e907526..9be4a18e03 100644 --- a/django/contrib/gis/db/models/__init__.py +++ b/django/contrib/gis/db/models/__init__.py @@ -1,6 +1,15 @@ +from django.core.exceptions import ImproperlyConfigured + # Want to get everything from the 'normal' models package. from django.db.models import * # NOQA +from django.contrib.gis.geos import HAS_GEOS + +if not HAS_GEOS: + raise ImproperlyConfigured( + "GEOS is required and has not been detected. Are you sure it is installed? " + "See also https://docs.djangoproject.com/en/stable/ref/contrib/gis/install/geolibs/") + # Geographic aggregate functions from django.contrib.gis.db.models.aggregates import * # NOQA |
