I am having some issues connecting to my database on MongoDB. I am using mongoengine library to connect to the DB. I am also using ATLAS. Whenever I try to run my project it keeps showing "Exception has occurred: ServerSelectionTimeoutError" then show [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate. Does anyone have any recommendations?
My code:
from enum import unique
from json import dumps
from mongoengine import *
from datetime import datetime
import json
import os
db_uri = "My link would go in here"
connect(host=db_uri)
class Artists(DynamicDocument):
artistName = StringField()
artistEarning = FloatField()
artistAlbumn = IntField()
dateAdded = DateTimeField(default=datetime.utcnow())
def json(self):
artist = {
"Artist": self.artistName,
"Artist Earnings": self.artistEarning,
"Amount of Albums": self.artistAlbumn,
"Info Added": self.dateAdded
}
return json.dumps(artist)
artists = Artists(
artistName="Post Malone",
artistEarning=20000.00,
artistAlbumn=20
).save()
print('Data Saved')