doableware / djongo

Django and MongoDB database connector
https://www.djongomapper.com
GNU Affero General Public License v3.0
1.88k stars 355 forks source link

NotImplemented Error on Django Admin #258

Open gevonstria opened 5 years ago

gevonstria commented 5 years ago

Creating a user via the terminal works well.

Creating a new user via the admin page yield the following error.

NotImplementedError at /admin/auth/user/add/

My versions: djongo 1.2 python 3.6

YohanVienne commented 5 years ago

Hello same error with initial project : NotImplementedError: UNKNOWN command not implemented for SQL SAVEPOINT "s3160_x2"

burakozturk16 commented 5 years ago

same error with initial project

NotImplementedError: UNKNOWN command not implemented for SQL SAVEPOINT

gtria-abiliti commented 5 years ago

I solved it by downgrading my Django version from 2.2. to Django 2.0.

Tisagh commented 5 years ago

I solved it by downgrading my Django version from 2.2. to Django 2.0.

This worked for me as well

santicalvo commented 5 years ago

I am having the same error. Any news about how to fix it?

santicalvo commented 5 years ago

Just to know, is there a plan to solve this issue or should I downgrade as @gtria-abiliti mentions?

bverem commented 5 years ago

Changes in Django 2.2 include:

DatabaseFeatures.uses_savepoints now defaults to True.

So, features.py should include uses_savepoints = False

I tested it locally and it works, but I don't really know how to change a public library like this one. However, that seems to be the fix if anyone else who isn't scared to totally bork the library wants to toss that fix in.

This appears to be the same issue as #254

hseritt commented 5 years ago

See issue #254. I've just downgraded Django to 2.1.8 for the time being. Man, I really want this package to remain viable. Mongo is a great pairing with Django :-)

funcionanonima commented 5 years ago

started to work on Djang. Hope to learn a lot to fix things such like this using djang 2.1.8 too

poco1980 commented 5 years ago

@bverem Where was this line located and on what file??

features.py should include uses_savepoints = False

bverem commented 5 years ago

djongo/features.py

It appears that line has been added in a commit about a week ago.

fl4p-old commented 5 years ago

Upgrade to git version with pip install -U "git+https://github.com/nesdis/djongo"

tiholic commented 4 years ago

I solved this by overriding the db backend. Create a folder called db in root app or any preferred location

in <defaultapp>/db/init.py

from djongo import *

in <defaultapp>/db/features.py

from djongo.features import DatabaseFeatures as DjongoDatabaseFeatures

class DatabaseFeatures(DjongoDatabaseFeatures):
    uses_savepoints = False

in <defaultapp>/db/base.py

from djongo.base import DatabaseWrapper as DjongoDatabaseWrapper

from .features import DatabaseFeatures

class DatabaseWrapper(DjongoDatabaseWrapper):

    features_class = DatabaseFeatures

Then change your db ENGINE config to 'ENGINE': '<defaultapp>.db'

Tisagh commented 4 years ago

I solved this by overriding the db backend. Create a folder called db in root app or any preferred location

in <defaultapp>/db/init.py

from djongo import *

in <defaultapp>/db/features.py

from djongo.features import DatabaseFeatures as DjongoDatabaseFeatures

class DatabaseFeatures(DjongoDatabaseFeatures):
    uses_savepoints = False

in <defaultapp>/db/base.py

from djongo.base import DatabaseWrapper as DjongoDatabaseWrapper

from .features import DatabaseFeatures

class DatabaseWrapper(DjongoDatabaseWrapper):

    features_class = DatabaseFeatures

Then change your db ENGINE config to 'ENGINE': '<defaultapp>.db'

What version(s) of Django does this work for? Since downgrading to 2.0 I've been hesitant to upgrade.

tiholic commented 4 years ago

@Tisagh it works with 2.2