Ticket #23901: patch_23901.diff

File patch_23901.diff, 1.6 KB (added by Kenial Sookyum Lee, 10 years ago)

patch of Ticket #23901

  • django/contrib/gis/db/backends/spatialite/base.py

    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):  
    4343        # (`libspatialite`). If it's not in the system library path (e.g., it
    4444        # cannot be found by `ctypes.util.find_library`), then it may be set
    4545        # 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.
    4649        self.spatialite_lib = getattr(settings, 'SPATIALITE_LIBRARY_PATH',
    47                                       find_library('spatialite'))
     50                                      find_library('mod_spatialite') or find_library('spatialite')
     51                                      )
    4852        if not self.spatialite_lib:
    4953            raise ImproperlyConfigured('Unable to locate the SpatiaLite library. '
    5054                                       'Make sure it is in your library path, or set '
Back to Top