-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does class MongoDBBackend accept a password parameter? #54
Comments
See: http://api.mongodb.org/python/current/api/pymongo/mongo_client.html |
Could I therefore use:
Two things I am confused about:
Sorry for asking so many questions, but I seem to be coming up against a few issues when implementing. Nevertheless, I hope they may be helpful for others implementing on OpenShift. |
No need to modify mongodb_backend.py - in your own code you can do: dbname = 'mydbname' "connection" would be used by any user within the same application. It should have limited access rights, e.g. update the collection that belong to your webapp and nothing more. |
Thank you for the clarification, that makes sense to me. |
I ran my application from shell and got error:
Looking at the class definition of This is the code in my application:
Note the value of
Update: I realised
And get the same error:
|
That's because the "hostname" variable is not defined. Use: |
working code:
|
In OpenShift, the standard way to login to MongoDB is with environment variables:
The environment variable
OPENSHIFT_MONGODB_DB_URL
consists of:You can also access these environment variables which are self explanatory:
But in any case, in OpenShift, you have to provide a password to access MongoDB.
I am editing
mongodb_backend.py
so that it can connect to the database at line 138:How can I add a
password
parameter to this class?(I am a bit of a newb with this, and trying to document my process as I go on the wiki so simple information appreciated if possible - thanks!)
The text was updated successfully, but these errors were encountered: