title: Using built in Django authentication/User model with Mongodb
body: <p>Switching over from sqlite to MongoDB and I followed all of the setup/configuration settings for <a href="http://django-mongodb.org/topics/setup.html" rel="nofollow noreferrer">Django MongoDB Engine</a>. Now when I go to add a user by returning an HTTP response from to the adduser method in views.py:</p>
  
  <pre><code> 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/")
  </code></pre>
  
  <p>This is the error I get:
  <code>DatabaseError at /adduser
  relation "auth_user" does not exist</code></p>
  
  <p>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)</p>
  
  <p>I saw <a href="https://stackoverflow.com/questions/4544473/django-authentication-mongodb">this</a> question but that was a year ago so hopefully things have changed by then as MongoDB has gained a lot of popularity this year.</p>