Hi, I'm trying to run this script to check if MongoDB atlas is working with python.
#!/usr/bin/python3.7
import pymongo
print("Content-Type: text/html\n\n")
mongoLink = "mongodb+srv://username:password@cluster0.wkb1y.mongodb.net/DjCh?retryWrites=true"
try:
myClient = pymongo.MongoClient(mongoLink)
print(myClient.list_database_names())
except Exception as e:
print(str(e))
The above script is working fine on my local mechine. I also allowed access from anywhere(0.0.0.0/0). But I'm getting this error on http://mahbd.heliohost.org/cgi-bin/test.py .
cluster0-shard-00-02.wkb1y.mongodb.net:27017: [Errno 111] Connection refused,cluster0-shard-00-01.wkb1y.mongodb.net:27017: [Errno 111] Connection refused,cluster0-shard-00-00.wkb1y.mongodb.net:27017: [Errno 111] Connection refused
How can I solve this?