1👍
✅
You separate the field name (here geom
) and lookup (here __contains
[Django-doc], with two consecutive underscores (__
), not a single underscore, so:
from app_name.models import CountryBorder
from django.contrib.gis.geos import Point
pnt = Point(23.1827, 75.7682)
CountryBorder.objects.get(geom__contains=pnt)
Source:stackexchange.com