Skip to content

Instantly share code, notes, and snippets.

@jkeyes
jkeyes / mongo.py
Created November 21, 2012 13:11 — forked from kennethreitz/mongo.py
MongoHQ w/ pymongo on Heroku
import os
import pymongo
from urlparse import urlparse
MONGO_URL = os.environ.get('MONGOHQ_URL')
if MONGO_URL:
# Get a connection
conn = pymongo.Connection(MONGO_URL)