I am Building a Webapp and I am stuck on an Error.
What i am trying to do
I am making a GeoDjango
app using Gdal
, OSGeo
, Postgresql
, Postgis
. All of them are successfuly installed.
Tutorial :- I am following this Tutorial
When i try to open the Shop
panel in Django Admin
then it is keep showing me
relation "mains_shop" does not exist LINE 1: SELECT COUNT(*) AS "__count" FROM "mains_shop"
And when i delete it and migrate again
then it shows
ValueError: String input unrecognized as WKT EWKT, and HEXEWKB.
But deleting migrations is solving ValueError
.
models.py
class Shop(models.Model):
name = models.CharField(max_length=100)
location = models.PointField()
address = models.CharField(max_length=100)
city = models.CharField(max_length=50)
admin.py
@admin.register(Shop)
class ShopAdmin(OSMGeoAdmin):
list_display = ('name', 'location')
settings.py
INSTALLED_APPS = [
'django.contrib.gis',
]
DATABASES = {
'default': {
'ENGINE': 'django.contrib.gis.db.backends.postgis',
'NAME': '-------',
'USER': '-------',
'PASSWORD': '-------',
'HOST': 'localhost',
'PORT': '',
}
}
What have i tried
First time when error appears then i think that
GDal
would not installed then I reinstalled it and it successfully installed.I have reinstalled
PostGis
.I have also seen many answers but nothing worked for me.
I have applied
migrations
many times.I also tried
python manage.py migrate --fake
.
I don't know what am i doing wrong.
Any help would be appreciated.
Thank You in Advance.