fatiherikli/dbpatterns — pull request #16 by ozgur (2013-04-22 11:43:11+00:00)
Title: MongoDB Authentication and Lazy Initialization

If authentication credentials are provided, we are trying to authenticate before getting the reference of the db connection.

The following credentials should be put into the settings file. They are not mandatory.

**MONGODB_USERNAME**: "ozgur"
**MONGODB_PASSWORD**: "dummy"

Besides, I also wrapped the mongodb connection with a lazy object in order to defer its initialization until actually needed.