django-rest-framework-mongoengine-example icon indicating copy to clipboard operation
django-rest-framework-mongoengine-example copied to clipboard

AttributeError: 'MongoUser' object has no attribute 'is_anonymous'

Open zohrenkz opened this issue 6 years ago • 3 comments

AUTHENTICATION_BACKENDS = ( 'mongoengine.django.auth.MongoEngineBackend', #'django_mongoengine.mongo_auth.backends.MongoEngineBackend', #'mongo_auth.backends.MongoEngineBackend', ) AUTH_USER_MODEL = 'mongo_auth.MongoUser'

MONGOENGINE_USER_DOCUMENT = 'userprofile.models.User'

zohrenkz avatar Jul 22 '18 09:07 zohrenkz

Versions please? I bet you're using wrong version of some library.

Try installing the exact versions from requirements.txt.

BurkovBA avatar Jul 23 '18 15:07 BurkovBA

Django==1.11.13 django-mongodb-engine==0.6.0 django-rest-framework-mongoengine==3.3.1 djangorestframework==3.8.2 djangotoolbox==1.8.0 mongoengine==0.9.0 pymongo==3.6.1 pytz==2018.4 six==1.11.0

zohrenkz avatar Jul 24 '18 09:07 zohrenkz

This example is tested to wok with:

django==1.9 djangorestframework==3.3.3 mongoengine==0.9 pymongo==2.7 django-rest-framework-mongoengine

I'm afraid, I can't offer a version that is guaranteed to work with later versions. If you could update some of those and send a PR, I'd be happy to accept it.

BurkovBA avatar Jul 24 '18 10:07 BurkovBA