【问题标题】:How to connect to pymongo with django如何使用 django 连接到 pymongo
【发布时间】:2020-07-12 07:03:06
【问题描述】:

我的数据库连接是

DATABASES = {
        'default': {
            'ENGINE': 'djongo',
            'ENFORCE_SCHEMA': True,
            'NAME': 'taxiapp',
            'HOST':'127.0.0.1',
            'PORT': xxxx,
        }
    }

我的SSH ADDRESS x.x.x.x SSH USERNAME 'admin'SSH PORT 0000SSH AUTH 方法密码和USER PASSWORD 0000

目前,我正在接受

pymongo.errors.ServerSelectionTimeoutError: 127.0.0.1:xxxx: [Errno 111] Connection refused

如何在我的settings.py 文件中定义 SSH 详细信息???

【问题讨论】:

    标签: django mongodb ssh python-3.6 pymongo


    【解决方案1】:

    您可以为此使用 Paramiko 库。

    效果很好。

    这里很好地解释了如何设置它。

    https://hackersandslackers.com/automate-ssh-scp-python-paramiko/

    一旦遇到问题,请不要犹豫。

    【讨论】:

      猜你喜欢
      • 2021-10-26
      • 2022-12-18
      • 2017-06-03
      • 2015-09-24
      • 1970-01-01
      • 1970-01-01
      • 2013-07-25
      • 2017-07-31
      • 2015-10-11
      相关资源
      最近更新 更多