How can I use the mongolab add-on to Heroku from python?

前端 未结 5 1328
旧时难觅i
旧时难觅i 2021-01-14 13:43

The documentation only talks about how to do it from ruby.

5条回答
  •  一向
    一向 (楼主)
    2021-01-14 14:36

    This is Will from MongoLab. We have a generic example of how to connect in Python using the official python driver (pymongo). This example is not for connecting from Heroku per say but it should be similar. The difference is that you will need to pluck your driver config from your Heroku ENV environment to supply to the driver.

    https://github.com/mongolab/mongodb-driver-examples/blob/master/python/pymongo_simple_example.py

    If you still have trouble feel free to contact us directly at support@mongolab.com

    -will

提交回复
热议问题