MongoLab/PyMongo connection error
问题 If I run in the shell: mongo ds0219xx.mlab.com:219xx/dbname -u user -p pass It works and allows me to connect to the database and pull information. But if I'm within my python application (Flask) and run this: import pymongo client = pymongo.MongoClient("mongodb://user:pass@ds0219xx.mlab.com:219xx/dbname") db = client["dbname"] db.users.insert_one({ "user1": "hello" }) It gives me an: pymongo.errors.OperationFailure: Authentication failed. I'm pretty sure it's failing before it gets to the