Changes between Initial Version and Version 1 of Ticket #28160


Ignore:
Timestamp:
May 1, 2017, 9:55:02 PM (7 years ago)
Author:
Tom Kazimiers
Comment:

Add monkey-patch workaround

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #28160 – Description

    initial v1  
    1818This is a problem in both Django 1.10 and 1.11.
    1919
     20A workaround for this is to run this code before the (postgis) database driver is loaded (e.g. through an own custom database driver that just sub-classes the original):
     21
     22{{{
     23import django.contrib.gis.gdal
     24class GDALRasterMock(object):
     25    pass
     26django.contrib.gis.gdal.GDALRaster = GDALRasterMock
     27}}}
     28
    2029¹ In my project I need to do the latter to disable GDAL support completely, because loading the library conflicts with `pgmagick` on Ubuntu and there is no other way to disable GDAL, but this shouldn't matter here. It would be nice though to have a way to force `HAS_GDAL = False`, because unlike said in `django/django/contrib/gis/gdal/__init__.py`, setting `GDAL_LIBRARY_PATH='/null/path'` doesn't work (the automatic OS checks override this).
Back to Top