Skip to main content

MoMa-Django provides native Django ORM and admin support for Mongo DB.

Project description


:Info: A Mongo Manager for Django, providing native Django ORM support for Mongo DB
:Version: 0.1.0
:Maintainer: Gadi Oren (

.. image::
:alt: Build Status


moma-django is a Mongo Manager for Django. **It provides native Django ORM support for Mongo DB**.

moma-django provides a framework to bridge between a SQL DB and the NonSQL MongoDB using a simple and powerful framework allowing an application to have models both on SQL database *and* on Mongo, and a quick experimentation / migration path from SQL only to a mixed model. Created and maintained by [Gadi Oren](, as a part of the [Lucidel]( and [Cloudoscope]( products.

* License: GPL license
* Documentation:


* Adoption: changing a model to reside on MongoDB is as simple as changing the inheritance from django.db.models.Model to MongoModel!
* Model features: large subset of the model capabilities is supported (e.g. unique together)
* Enhanced model: Mongo models can include lists and dictionaries as a field
* Django administration: most of the administration functions are supported for Mongo based models
* Testing: support the creation of an alternative mongodb collection for unit tests
* Relationships between models on SQL db and Mongo: limited support. ForeignKeys can be defined but transactions or cascading delete is not supported
* Django query: support for queries (e.g. `date__gte` notation) as well as Q statements. Not supported yet: annotations and aggregations
* Enhanced Django query: queries can include "drill into" objects. E.g. for a record `entry = {a:3, b:{k1:4, k2:3,km:'a'}}` you can query: `qs = Entry.objects.filter(a__gte=2,b__km__regexp='^a$') )` (note the `b__km__regexp` "drill into")
* South: applications can contain regular and mongo models. However, in order to use south, the mongo models should be excluded of the south management (see documentation on how to exclude mongo models)
* loaddata_mongo: utility that allows loading of fixtures

There are other packages out there that create tight integration between MongoDB and django. **Why use this one?**
This package was originally created as a part of very careful experimentation with MongoDB, and developed in small increments. The reason was
that we couldn't afford a radical change like replacing the entire Django or moving completely to a NoSQL type of environment.
This package allowed us to enjoy both worlds without massive impact on the project. It is used in production, as part of a high scale & performance project.
If that is the type of decision and constraints that you are facing, this package may be a good option.


Get MongoDB::

Download the right version per

Get pymongo:

pip install pymongo=>2.1.1

Get the code::

pip install moma-django==0.1.0

Install the dependency in your



All the documentation for this project is hosted at

* Django 1.4.1
* PyMongo 2.1.1
* djangotoolbox 0.9.2

Quick start

* Install (or clone the repo, `git clone git://`).
* Please read "Example application README" ( about running the example application.


Releases will be numbered with the following format:


And constructed with the following guidelines:

* Breaking backward compatibility bumps the major (and resets the minor and patch)
* New additions without breaking backward compatibility bumps the minor (and resets the patch)
* Bug fixes and misc changes bumps the patch

Bug tracker

Have a bug? Please create an issue here on GitHub that conforms with [the guidelines](

Twitter account

Please follow us on Twitter, [@cloudoscope_inc](
Keep up to date on announcements and more by following Gadi on Twitter, [@gadioren](


Cloudoscope blog can be found [here](
Read more detailed announcements, discussions, and more on [The Official Blog](


How to test: Please read [Example application README]( about running the unit tests.

More information

Watch the [presentation] (
and the [video] (


Please submit all pull requests against *-wip branches. When relevant, you must include relevant unit tests. Thanks!


**Gadi Oren**


Additional contributor (as part of a contract position with Lucidel)

Copyright and license

Copyright 2012 Lucidel, Inc., 2013 Cloudoscope Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this work except in compliance with the License.
You may obtain a copy of the License in the LICENSE file, or at:

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
See the License for the specific language governing permissions and
limitations under the License.

Support this project!

You can hire the lead maintainer to perform dedicated work on this package. Please email gadi.oren.1 at


0.1.0 (2014-03-01)

* First release on PyPI.

0.1.1 (2014-03-10)

* Minor bugfixes in the example application: incorrect reference to static files location.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

moma-django-0.1.1.tar.gz (193.8 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page