我正在开发一个向 Mongolab 提交数据的 Python 程序,我遇到了一个奇怪的异常:
mongoengine.connection.ConnectionError: Cannot connect to database mongodb://<user>:
<password>@ds035617.mongolab.com:35617/<mydatabase>:
could not connect to localhost:27017: [Errno 10061] No connection could be made
because the target machine actively refused it
这是有问题的代码:
from mongoengine import *
connect('tablename', "mongodb://<user>:<password>@ds035617.mongolab.com:35617/<mydatabase>")
任何人对什么是错的有任何想法?