This PR updates the MongoDB connection logic in the Django MongoDB integration to be compatible with PyMongo 4.x. The old method of authenticating db via self.database.authenticate(user, password) has been removed, since it was deprecated and fully removed in PyMongo 4.x.
Changes Made:
Refactored the _connect() method to utilize the predefined options to handle user credentials.
Removed the deprecated authenticate(user, password) method.
Added checks to prevent conflicting credentials between USER/PASSWORD (from settings) and OPTIONS['username'] / OPTIONS['password'].
This PR updates the MongoDB connection logic in the Django MongoDB integration to be compatible with PyMongo 4.x. The old method of authenticating db via
self.database.authenticate(user, password)
has been removed, since it was deprecated and fully removed in PyMongo 4.x.Changes Made:
_connect()
method to utilize the predefined options to handle user credentials.authenticate(user, password)
method.USER/PASSWORD
(from settings) andOPTIONS['username']
/OPTIONS['password']
.