Skip to content

Conversation

@caruccio
Copy link

I'm not sure, but it looks like we need to authenticate before accessing a database on a remote mongod.
Maybe that is something new from pymongo/mongokit ?
Warning: code wasn't tested to exhaustion.

I'm not sure, but it looks like we need to authenticate before accessing a database on a remote mongod.
Maybe that is something new from pymongo/mongokit ?
Warning: code wasn't tested to exhaustion.
@peterbe
Copy link
Owner

peterbe commented Apr 19, 2013

Have you tried this locally? Have you tried running the tests for it?

db = this_connection[settings.MONGO_DATABASE_NAME]
try:
db.authenticate(settings.DATABASES['mongodb'].get('USER', ''), settings.DATABASES['mongodb'].get('PASSWORD', ''))
except AttributeError:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the point of this exception?

@caruccio
Copy link
Author

Yes, I have tried it. In fact it is running smooth right now on my production server.
I ran coverage test and got:

...../home/mateus/.virtualenvs/getup-admin/local/lib/python2.7/site-packages/pymongo/common.py:529: DeprecationWarning: The safe parameter is deprecated. Please use write concern options instead.
  "write concern options instead.", DeprecationWarning)

..........Destroying test database 'mongodb'...
..Destroying test database 'mongodb'...
.....
----------------------------------------------------------------------
Ran 22 tests in 0.765s

OK
Name               Stmts   Miss  Cover
--------------------------------------
__init__               3      3     0%
document              61      2    97%
mongodb/__init__       0      0   100%
mongodb/base          98     98     0%
shortcut              30     12    60%
--------------------------------------
TOTAL                192    115    40%
htmlcov/index.html

@caruccio
Copy link
Author

That may fix. Coverage ran OK (django 1.5 only). Travis is failing with 'connection refused' to mongodb.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants