title: Django Authentication credentials separate from user data
body: <p>I am building a system where many accounts will not have login credentials (e.g companies) unless specifically provided. In order to achieve this, I have the following account model (not implemented yet, currently designing on a piece of paper):</p>
  
  <pre><code>Table: Account
    Fields: ID, fname, lname, type, created_at, activated_at
  
  Table: AccountCredentials
    Fields: Account ID, email, password
  
  Relations:
    Account &lt;- 1-to-1 -&gt; AccountCredentials
  </code></pre>
  
  <p>All permissions, operations etc will be performed over the Account model; so, the Account model will be the django auth user model. </p>
  
  <p>I have used custom User models and managers before; however, this is something I am not sure how to implement.</p>
  
  <p>How should I tell the AbstractBaseUser model to authenticate using <code>credentials.email</code> and <code>credentials.password</code> (<code>credentials</code> being the relation name between Account and AccountCredentials)? From checking AbstractBaseUser source code and checking some files, it seems like I can override <code>get_username</code> method; so that, the username field is being read from credentials. However, I am not sure how to do the same for password as it is hard coded in model.</p>