I use Flask and Flask-Pymongo
from flask_pymongo import PyMongo
user = PyMongo(app, uri='mongodb://username:[email protected]:27018/user')
pymongo.errors.OperationFailure: Authentication failed.
But using Pymongo with same mongodb uri then work.
import pymongo
db = pymongo.MongoClient('mongodb://username:[email protected]:27018')