A
A
Anton2018-12-06 13:51:09
Django
Anton, 2018-12-06 13:51:09

How to create a spatial database to work with GeoDjango?

I'm trying to understand using GeoDjango, following this instruction:
https://code-examples.net/ru/docs/django~2.0/ref/c...
After creating a model and running the command python manage.py sqlmigrate world 0001: I see an
error :
AttributeError: 'DatabaseOperations' object has no attribute 'geo_db_type'
Most likely this is due to the fact that I could not install SpatiaLite spatial database...
I don't understand how it is installed on Windows, I go to the site: https://www .gaia-gis.it/gaia-sins/, followed
the link: www.gaia-gis.it/gaia-sins/windows-bin-amd64
downloaded the file from there: spatialite.exe
And what to do next with it is not clear :( Please tell me what this error is connected with and how to set up a spatial database to work with GeoDjango?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vadim Shatalov, 2018-12-06
@netpastor

SpatiaLite is needed to support sqlite
I recommend using Postgres+PostGis

D
Dmitry, 2018-12-08
@pyHammer

First, you need to master Linux. This is just the bare minimum if you're serious about web development.
Secondly, PostgreSQL handles spatial data better (I didn’t even consider alternatives myself). Here is a comprehensive manual for using PostgreSQL and PostGIS , here is PostgeSQL how to install and how to connect PostGIS.
You will also need this . This is enough for Django to work with PostgreSQL.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question