python - how to use MongoHQ database in openshift app -
python - how to use MongoHQ database in openshift app -
at first tried:
import pymongo mongohq_url = "mongodb://username:password@kahana.mongohq.com:10025/dbname" conn = pymongo.mongoclient(mongohq_url)    but apparently failed , throws next error:
traceback (most recent  phone call last):   file "bot.py", line 95, in <module>     conn = pymongo.connection(mongohq_url)   file "/var/lib/openshift/53abb500028e/python/virtenv/lib/python2.7/site-packages/pymongo/connection.py", line 236, in __init__     max_pool_size, document_class, tz_aware, _connect, **kwargs)   file "/var/lib/openshift/53abb500028e/python/virtenv/lib/python2.7/site-packages/pymongo/mongo_client.py", line 369, in __init__     raise connectionfailure(str(e)) pymongo.errors.connectionfailure: [errno 13] permission denied    they have example, it's in ruby , have no idea. if not wrong, guess connection happening in this script.
can makeout ruby code , help me can  utilize in python script pymongo? have set environment variable mongo_url
 python ruby openshift pymongo mongohq 
 
Comments
Post a Comment