From bc98b1be6b5280afcd41c853cabc5bee7b8d83d1 Mon Sep 17 00:00:00 2001
From: Kenial Lee <keniallee@gmail.com>
Date: Sun, 23 Nov 2014 16:54:06 -0800
Subject: [PATCH] Workaround for libspatialite 4.2.0 package on Homebrew: it
requires mod_spatialite.dylib, if it exists.
---
django/contrib/gis/db/backends/spatialite/base.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/django/contrib/gis/db/backends/spatialite/base.py b/django/contrib/gis/db/backends/spatialite/base.py
index e51ffbe..4a0f290 100644
a
|
b
|
class DatabaseWrapper(SQLiteDatabaseWrapper):
|
43 | 43 | # (`libspatialite`). If it's not in the system library path (e.g., it |
44 | 44 | # cannot be found by `ctypes.util.find_library`), then it may be set |
45 | 45 | # manually in the settings via the `SPATIALITE_LIBRARY_PATH` setting. |
| 46 | # |
| 47 | # `mod_spatialite` is workaround for libspatialite 4.2.0 package on OS X. |
| 48 | # It requires mod_spatialite.dylib instead of libspatialite.dylib. |
46 | 49 | self.spatialite_lib = getattr(settings, 'SPATIALITE_LIBRARY_PATH', |
47 | | find_library('spatialite')) |
| 50 | find_library('mod_spatialite') or find_library('spatialite') |
| 51 | ) |
48 | 52 | if not self.spatialite_lib: |
49 | 53 | raise ImproperlyConfigured('Unable to locate the SpatiaLite library. ' |
50 | 54 | 'Make sure it is in your library path, or set ' |