def has_mongo():
    'Determine if MongoDB is up and usable'
    if os.environ.get('MP_FAKEMONGO'):
        mongo = False
    else:
        try:
            pymongo.MongoClient()
            mongo = True
        except:
            mongo = False
    return mongo
Determine if MongoDB is up and usable
def has_mongo():
    
    if os.environ.get('MP_FAKEMONGO'):
        mongo = False
    else:
        try:
            pymongo.MongoClient()
            mongo = True
        except:
            mongo = False
    return mongo