peterbe / django-mongokit

Bridging Django to MongoDB with the MongoKit ODM (Object Document Mapper)
Other
122 stars 20 forks source link

Auth to remote mongod #13

Open caruccio opened 11 years ago

caruccio commented 11 years ago

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 commented 11 years ago

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

caruccio commented 11 years ago

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 commented 11 years ago

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