The code is
mongoengine.connect('admin', host='xxx.dotcloud.com', port=16333 , username='root', password='pass')
and it shows the error message that:
09:37:43 [www.0] raise TypeError("port must be an instance of int")
I’ve tried int(16333), still not working.
I’m new to python, could you give me some advise on that? I’m totally confused.
You can rest assured that
16333is indeed anint:So, the problem must come from elsewhere. Chances are you have an invalid port number set in your MongoDB configuration file, and
connect()tries to parse it even if you provide aportargument.