我怎样才能从python中使用mongolab插件到Heroku? [英] How can I use the mongolab add-on to Heroku from python?

查看:100
本文介绍了我怎样才能从python中使用mongolab插件到Heroku?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

文档只讨论了如何从ruby中完成它。

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

推荐答案

这是来自MongoLab的Will。我们有一个通用的例子,说明如何使用官方的Python驱动程序(pymongo)在Python中进行连接。这个例子并不是用来连接Heroku,而应该是类似的。不同之处在于您需要从Heroku ENV环境中提取驱动程序配置以提供给驱动程序。

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

如果您还有麻烦随时直接联系我们support@mongolab.com

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

- 愿意

这篇关于我怎样才能从python中使用mongolab插件到Heroku?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆