'gis': {
'ENGINE': 'django.contrib.gis.db.backends.postgis',
'OPTIONS': {
'options': '-c search_path=pyagro'
},
Installed Apps
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'rest_framework',
'django.contrib.gis',
'
apps.mobi',
'apps.api'
]
--- MOdels
class Polygons(models.Model):
admin = models.ForeignKey(Admin, on_delete=models.CASCADE)
farmer_id = models.IntegerField()
feature_data = models.JSONField(default=dict)
shape = models.GeometryField(srid=3857, null=True, blank=True)
cropper_ref = models.CharField(max_length=200)
area = models.FloatField()
polygon_type = models.IntegerField()