djongo
djongo copied to clipboard
Connection error when using migrate or makemigrations - Azure Cosmo DB - mongodb
After using the connection string given by Azure Cosmo DB, the djongo/pymongo triggers an error.
pymongo.errors.ServerSelectionTimeoutError: hangapp.documents.azure.com:10255: timed out
This is the string that I have been using in Django for the database.
DATABASES = {
'default': {
'ENGINE': 'djongo',
'NAME': 'hangapp',
'HOST': 'mongodb://
}
}
It seems the problem is the ssl connection equal true. I have used Atlas with the next string and it works.
DATABASES = {
'default': {
'ENGINE': 'djongo',
'NAME': 'hangapp',
'HOST': 'mongodb+srv://
I have connected to azure in local, and it works using the Mongo DB Compass software.
Has somebody had the same problem?
i'm having the same issue
any fix? I also am getting other errors trying to use cosmos :(
This is the configuration I'm using
'default': {
'ENGINE': 'djongo',
'ENFORCE_SCHEMA': False,
'NAME': 'yourdatabasename',
'CLIENT': {
'host': 'yourdatabasename.mongo.cosmos.azure.com',
'port': 10255,
'username': 'theusernameyouset',
'password': 'thelongonefromtheportal==',
'authMechanism': 'SCRAM-SHA-1',
'ssl': True,
'tlsAllowInvalidCertificates': True,
'retryWrites': False
}
}