seetings.py
DATABASES = {
'default': {
'ENGINE':'django.db.backends.mysql','django.contrib.gis.db.backends.mysql'
'OPTIONS': {
'read_default_file': os.path.join(PROJECT_ROOT,"my.cnf"),
},
},
}
without 'django.contrib.gis.db.backends.mysql' the code is working fine but since i want to use django geolocation using mysql, i added this (if I don't add I get
'databaseoperations' object has no attribute 'geo_db_type'
error), and now I am getting
django.db.utils.OperationalError: (1045, "Access denied for user ---" error although the user has full privileges.
Please help I am new to django
Thank you
It seems like you try to set multiple database backends in your settings but you need just one: django.contrib.gis.db.backends.mysql
works for both spatial and non-spatial use cases.
So your settings.py
should probably look something like this:
DATABASES = {
'default': {
'ENGINE': 'django.contrib.gis.db.backends.mysql',
'OPTIONS': {
'read_default_file': os.path.join(PROJECT_ROOT,"my.cnf"),
},
},
}