[Answered ]-Django and MongoDB issues with Django admin

1👍

Seems there is a problem with permission app, Try to add djangotoolbox to you settings.py.

The nature of NoSQL is not compatible with django ORM neither with auth, permission apps which they depends on JOINS to working together.

Anyway, Have you met django-nonrel ? django-nonrel provides more apps and solutions to work with MongoDB and other NoSQL datastores.

1👍

See this link: https://github.com/django-nonrel/mongodb-engine/pull/134

The main issue is that for collections that have an uncapped size, set a large capped size instead of so that the subsequent command does not fail.

I’m assuming you’re on django-nonrel 1.3.1. I forked off of django-nonrel/mongodb-engine and have the fix in https://github.com/statguyjames/mongodb-engine.git@master.

0👍

First I tried statguy’s solution by replacing sql_create_model() method entirely – but it didn’t work, some errors kept appearing.

Then what I did was that I added

size = getattr(model._meta, 'collection_size', None)
if size is not None:
    kwargs['size'] = size
else:
    kwargs['size'] = 10000000000

right after

for option, mongo_option in [
        ('capped', 'capped'),
        ('collection_size', 'size'),
        ('collection_max', 'max')
    ]:
        kwargs[mongo_option] = getattr(model._meta, option, False)

in file creation.py from django_mongodb_engine.

This way the error wasn’t appearing anymore. However, due to that immense value, mongo will allocate some files on disk that have basically turned my current database from a few MB to about 17GB – ending in an error to allocate new file.

So careful about enforcing a value. I might be missing something, though.

Leave a comment