GeoDjango

Django MongoDB Backend supports GeoDjango.

Each model field stores data as GeoJSON objects.

All fields have a 2dsphere index created on them.

The following spatial lookups are supported:

You can also use any of the geospatial query operators or the geospatial aggregation pipeline stage in raw_aggregate() queries.

Added in version 6.0.1: Support for spatial lookups was added.

Configuration

  1. Install the necessary Geospatial libraries (GEOS and GDAL).

  2. Add django.contrib.gis to INSTALLED_APPS in your settings. This is so that the gis templates can be located – if not done, then features such as the geographic admin or KML sitemaps will not function properly.

Limitations