Connection Python to Atlas is not working - Target machine refused it

I’ve tried connect the application test using Python mentioned in

In my personal computer using home internet connection or 4G the test works. But using my computer or another one in school internet it does not work.

The whitelist IP of Atlas allows any connection, even cause I can connect using 4G connection.

The code is

from pymongo import MongoClient

from pprint import pprint

client = MongoClient(‘mongodb://’)



And the erros is

Is your connect string correct?
Check the hostname after @
Can you connect by shell?
Can you ping your cluster?