[Django]-How to get GeoJSON response in Django REST framework gis

3👍

You might only have the above error in the browsable API, because the default djanog-rest-framework html template renderer does not work with the GeoJson format.

To test if that is the case, try to call your api endpoint requesting it in json format, i.e. /api/newpark.json or equivalently /api/newpark?format=json. This should show you geojson data, if it does your backend API is fine, and the problem is the browsable html form.

If you want a browsable API for your GeoJson endpoint, then you might need to change the html template used to render your API end point.

Leave a comment