I'm trying to connect to a Mongo DB with Django and Mongokit (using django-mongokit). When I try to feed it a remote
In settings.py:
DATABASES = {
'default': dj_database_url.config(default=os.environ['DATABASE_URL']),
'mongodb': dj_database_url.parse(os.environ['MONGOHQ_URL']),
}
DATABASES is correctly populated with connection data, for what it's worth.
In the main routine:
from mongokit import Connection
# ...
conn = Connection('mongodb')
conn.register([Account])
db = conn.foo
collection = db.bar
This throws a getaddrinfo failed
error. Connection(), it seems, wants a PymongoConnection, but I'm not sure how to get that. And when I try feeding a remote URL into DATABASES.mongodb, it freaks out as well. Any ideas?
Edit: Not really a solution, but I ended up just using pymongo straight rather than django-mongokit. Oh well.