-1

I am creating django app, I am using

  1. django 1.10
  2. mongodb in backend.
  3. To connect with mongodb I am using mongoengine 0.11 and pymongo 3.4

when I try to import User from mongoengine.django.auth, it is giving error as-

from mongoengine.django.auth import User
   ImportError: No module named django.auth

can anyone help me to implement authentication using mongoengine. Some posts suggest that I should use mongoengine 0.9 but I am afraid to downgrade version as we are using mongoengine 0.11 on production and there is lot of code already written using it.

Can you please suggest me solution which does not involve changing version of above mentioned packages. Whereas I can use any other stable packages as long as existing functionality doesn't break. Or is there any way to implement authentication using django's custom authentication classes, and use relational database only for authentication.

Amax
  • 47
  • 8
sachin27
  • 145
  • 3
  • 13

1 Answers1

0

Django by default doesn't provide any support for NoSQL database. mongoengine is python package to connect with MongoDB so it doesn't provide any direct support for authentication.Check this website if you can find any mongo backend for django https://github.com/django-nonrel.

Darshan
  • 447
  • 3
  • 17
  • Do I have to change my current django version. As per my understanding I have to use django-nonrel. I am expecting solution for which I don't need to change my current package version. Can anyone help. – sachin27 Feb 10 '17 at 13:24