1

Switching over from sqlite to MongoDB and I followed all of the setup/configuration settings for Django MongoDB Engine. Now when I go to add a user by returning an HTTP response from to the adduser method in views.py:

 def adduser(request):
     username = request.POST['username']
     password = request.POST['password']
     u = User.objects.create_user(username, request.POST['email'], password)
     u.save()
     a = Accounts(user=u)
     p = Passwords(user=u)
     a.save()
     p.save()
     user = authenticate(username=username, password=password)
     if user is not None and user.is_active:
         auth.login(request, user)
         return HttpResponseRedirect("/%s/" %u.id)
     else:
         return HttpResponseRedirect("/account/invalid/")

This is the error I get: DatabaseError at /adduser relation "auth_user" does not exist

Naturally the relationship doesn't exist since MongoDB NoSQL. Is the auth system not supported or does Mongo-engine have a better solution? Perhaps I should just move to Postgre? (sqlite cannot handle the simultaneous users so isn't a viable option)

I saw this question but that was a year ago so hopefully things have changed by then as MongoDB has gained a lot of popularity this year.

0

1 Answer 1

1

MongoEngine provides authentication for Django apps with MongoDB.

Sign up to request clarification or add additional context in comments.

1 Comment

It's just fork of django.contrib.auth, and i can say it's outdated due to use of deprecated hashing password and etc...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.