pymongo.errors.ServerSelectionTimeoutError: 127.0.0.7:20002: [Errno 111] Connection refused, Timeout: 30s, code example
Example: pymongo.errors.ServerSelectionTimeoutError: localhost:27017
# maybe your server inactive state check that onces
service mongodb status
#if Active: inactive then start your server up and run
service mongodb start
# after that exicute your code