I am using multiple databases in Django,
On the current server, PostGIS is installed and am trying to connect POSTGRESQL from another server,
settings.py
DATABASES = {
'default': {
'ENGINE': 'django.contrib.gis.db.backends.postgis',
'NAME': 'db_name_1',
'USER': 'user_name_1',
'PASSWORD': '',
'HOST': '',
'PORT': '',
},
'users_db' : {
'NAME' : 'db_name_2',
'ENGINE' : 'django.db.backends.postgresql_psycopg2',
'HOST' : '',
'PORT' : '',
'USER' : 'user_name_2',
'PASSWORD' : '',
},
# 'users_db' : dj_database_url.config(default='postgres://user_name_2:password_2@host_2:0000/db_name_2')
}
Now as per documentation.
Error
python3 manage.py migrate --database='users_db'
AttributeError: 'DatabaseOperations' object has no attribute 'geo_db_type'
UPDATE
As per other StackOverflow pages, I found dj-database-url
i used it but still problem persists.
for dj-database-url
'users_db' : dj_database_url.config(default='postgres://user_name_2:password_2@host_2:0000/db_name_2')
Any help will be appreciated,
Thanks & Regards
You are trying to migrate geospatial enabled objects to non geospatial database...when connected another database contrib.gis.db.backend.postgis should be on the second database to only the host and ports are to change