django-leaflet
django-leaflet copied to clipboard
Silet fail when GDAL not installed
When libgdal is not installed, the widget doesn't show, in admin even no field is displayed (blank page). I didn't found any error until I used pudb for django-leaflet itself, the error is below. In installation section of documentation is also no mention of this.
The desired behaviour is, that the exception is not catched somewhere, but is thrown outside. Also the documentation should be completed.
Traceback (most recent call last):
File "<pudb command line>", line 1, in <module>
File "/home/pdlouhy/dpnk/env/src/django/django/contrib/gis/forms/widgets.py", line 73, in render
serialized=self.serialize(value),
File "/home/pdlouhy/dpnk/env/src/django-leaflet/leaflet/forms/widgets.py", line 34, in serialize
return value.geojson if value else ''
File "/home/pdlouhy/dpnk/env/src/django/django/contrib/gis/geos/geometry.py", line 422, in json
raise GEOSException('GeoJSON output only supported when GDAL is installed.')
GEOSException: GeoJSON output only supported when GDAL is installed.
Thank you for this feedback :)
If you like, you can submit a pull-request, we'll review it and merge it !
We would welcome any help for maintaining this library. If you use it and find it useful, please Watch it on Github, help us review contributions or comment issues :) Thousand thanks in advance.
Related: https://github.com/makinacorpus/django-geojson/issues/75