I have installed mongodb and enabled auth. and its working find. I can connect it from remote notebook using robomongo application:
Host: SERVER_IP
PORT: 270
This worked for me ....
import pymongo
client = pymongo.MongoClient("mongodb://username:12%40password@ip:27017/sample_db",authSource="admin")
db = client['sample_db']
Remember if you have special characters in your password (e.g. #,@) you will need to encode them (see %40) in the password. If you do not do authSource="admin" you will receive authentication errors. username - your mongodb username, ip - ip address as this assumes database is hosted on a remote server. sample_db is the database that you would like to access.