title: How to configure two AUTH_USER_MODEL in Django Authentication
body: <p>I'm using django's authentication to login users. But I have two models from where <code>authenticate</code> method would check the user credentials. One is <code>ApplicationUser</code> and the other is <code>SystemUser</code> I have made one of them and it works fine like so:</p>
  
  <p><strong>models.py</strong></p>
  
  <pre><code>class UserManager(BaseUserManager):
      def create_user(self, email, password=None):
          """
          Creates and saves a User with the given username and password.
          """
          ....
          return user
  
      def create_superuser(self, email, password):        
          ...
          return user
  
  
  class ApplicationUser(AbstractBaseUser):
      application_user_id = models.AutoField(primary_key=True)
      ....
      ....
  </code></pre>
  
  <p><strong>views.py</strong></p>
  
  <pre><code>def login_view(request):
       ...
       user = authenticate(username = email, password = password)
       if user is not None:
           ...
           login(request, user)
           ....
           ....
  </code></pre>
  
  <p>I came through this problem and got <a href="https://stackoverflow.com/questions/19253842/whats-the-proper-way-to-use-multiple-auth-user-model-in-django-1-5">here</a> but I couldn't work out a solution to this.</p>
  
  <p><strong>My Questions:</strong></p>
  
  <ol>
  <li><p>How do I specify two <code>AUTH_USER_MODEL</code>, as of yet I have set
  <code>ApplicationUser</code> as <code>AUTH_USER_MODEL</code>.</p></li>
  <li><p>And even if I somehow specify
      the two <code>AUTH_USER_MODEL</code>, how do the <code>authenticate</code> or <code>login</code> function
      know where (<code>ApplicationUser</code> or <code>SystemUser</code>) to match the credentials and create session for the user
      accordingly</p></li>
  </ol>