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.