django.db.utils.ProgrammingError: type "geometry" does not exist

96 views
Skip to first unread message

Bakhodir Ramazonov

unread,
Jan 20, 2021, 2:32:55 AM1/20/21
to geodjango
'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()

Claude Paroz

unread,
Jan 20, 2021, 2:34:52 AM1/20/21
to geod...@googlegroups.com
Is your database GIS-enabled? (CREATE EXTENSION postgis;) ?

Le 20.01.21 à 06:18, Bakhodir Ramazonov a écrit :
Reply all
Reply to author
Forward
0 new messages