简体   繁体   中英

Django mongodb auth with mongoengine error

I try to extend basic user document from mongo and normally i would do it like this:

from mongoengine.django.auth import User

class Account(User):
    field1=something1
    field2=something2

etc.

Somehow i just can't import django.auth from mongoengine. It just says: ImportError: No module named django.auth

And actually it worked for me couple of months ago and that is why i am confused.

I have installed django, and then according to the docs: django-nonrel, djangotoolbox, mongodb engine all in virtual env.

Then i've installed mongoengine using pip.

In settings.py i also included in installed apps 'mongoengine' and it worked fine, but i still can't import django.auth.

Am i missing something here?

Problem solved.

Just for anyone that will be struggling with this.

django.auth or even mongoengine.django is not included in mongoengine 0.10 as it seems but it is in 0.9 so i downgraded it.

Also to get connection working properly i needed to update pymongo from 2.7.1 to 2.8.1 and now it all works fine.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM