mongoengine
mongoengine copied to clipboard
Username and password must be escaped according to RFC 3986, use urllib.parse.quote_plus().
Hi there, my python code is
user = urllib.parse.quote_plus(os.getenv("USER"))
passwd = urllib.parse.quote_plus(os.getenv("PASS"))
connect(os.getenv("MONGO_DATABASE"), host= "mongodb+srv://%s:%s@[email protected]/%s?retryWrites=true&w=majority" % (user, passwd, os.getenv("MONGO_DATABASE")))
I'm using urllib.parse.quote_plus() still getting the following issue
raise InvalidURI("Username and password must be escaped according to "
pymongo.errors.InvalidURI: Username and password must be escaped according to RFC 3986, use urllib.parse.quote_plus().
Hope this will help you! https://www.wtsol.org/2021/01/31/djangopythonwebsitewithadmin/ https://stackoverflow.com/questions/39237813/how-to-escape-in-a-password-in-pymongo-connection
Thank you @Altaf12sees ..
https://stackoverflow.com/questions/39237813/how-to-escape-in-a-password-in-pymongo-connection
this helped...