This page explains how to install and configure a Django/MongoDB setup.
Django MongoDB Engine depends on
It’s highly recommended (although not required) to use a virtualenv for your project to not mess up other Django setups.
If not already installed, grab a copy from the Cheeseshop:
pip install virtualenv
To set up a virtual environment for your project, use
virtualenv myproject
To join the environment, use (in Bash):
source myproject/bin/activate
pip install git+https://github.com/django-nonrel/django@nonrel-1.4
pip install git+https://github.com/django-nonrel/djangotoolbox@toolbox-1.4
You should use the latest Git revision.
pip install git+https://github.com/django-nonrel/mongodb-engine@mongodb-engine-1.4-beta
Database setup is easy (see also the Django database setup docs):
DATABASES = {
'default' : {
'ENGINE' : 'django_mongodb_engine',
'NAME' : 'my_database'
}
}
Django MongoDB Engine also takes into account the HOST, PORT, USER, PASSWORD and OPTIONS settings.
Possible values of OPTIONS are described in the settings reference.
That’s it! You can now go straight ahead developing your Django application as you would do with any other database.