Skip to content

OSError exception #125

@andywar65

Description

@andywar65

django-geojson tries to use django.contrib.gis objects, but if ImportError or ImproperlyConfigured exceptions are raised, it fallbacks to custom nogeos objects. In my case (working on Windows) an OSError exception is raised, breaking the code. I added this exception to a fork of the library and everything seems to work fine:

# djgeojson/templatetags/geojson_tags.py
except (ImportError, ImproperlyConfigured, OSError):

# djgeojson/fields.py
except (ImportError, OSError):

# djgeojson/serializers.py
except (ImportError, ImproperlyConfigured, OSError):

Of course my issue depends on a local configuration, but the fix suggested makes life easier to the unexperienced.
Thanks a lot for the library, by the way!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions