This page explains how to install and configure a Django/MongoDB setup.


Django MongoDB Engine depends on

  • Django-nonrel, a fork of Django that adds support for non-relational databases
  • djangotoolbox, a bunch of utilities for non-relational Django applications and backends

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+


pip install git+

Django MongoDB Engine

You should use the latest Git revision.

pip install git+


Database setup is easy (see also the Django database setup docs):

   '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.