title: After switching from Django's default Users model to an AbstractUser model, Admin is looking for a Users_groups table
body: <p>It became apparent the default User model wasn't going to work for me, nor extending it, so decided to make an <code>AbstractUser</code> model to use an existing table.</p>
  
  <p>Pretty much have everything working, except when I go to edit a user in Django Admin, I am getting an error:</p>
  
  <pre><code>ProgrammingError at /adminauthentication/user/100826/change/
  (1146, "Table 'test_db.Users_groups' doesn't exist")
  </code></pre>
  
  <p>Not sure why it is trying to find this table as I haven't specified it, don't recall in the documentation needing to specify it, and thought <code>AbstractUser</code> would use other default tables that created with the initial <code>migrate</code> (e.g. <code>auth_group</code> or something).</p>
  
  <p>Not quite sure how to resolve, but I am looking into it.</p>
  
  <pre><code># ./admin.py
  
  from django.contrib import admin
  from django.contrib.auth.admin import UserAdmin
  from .models import User
  
  admin.site.register(User, UserAdmin)
  </code></pre>
  
  <hr>
  
  <pre><code># ./models.py
  from django.db import models
  from django.contrib.auth.models import AbstractUser
  
  # Create your models here.
  
  # Extend the User model
  class User(AbstractUser):
      id = models.AutoField(primary_key=True)
      username = models.CharField(max_length=255, blank=False, null=False, unique=True)
      first_name = models.CharField(max_length=255, blank=True, null=True)
      last_name = models.CharField(max_length=255, blank=True, null=True)
      email = models.CharField(max_length=255, blank=True, null=True)
      phone = models.CharField(max_length=255, blank=True, null=True)
      password = models.CharField(max_length=255, blank=True, null=True)
      ip_whitelist_1 = models.CharField(max_length=32, blank=True, null=True)
      ip_whitelist_2 = models.CharField(max_length=32, blank=True, null=True)
      ip_whitelist_3 = models.CharField(max_length=32, blank=True, null=True)
      last_login = models.DateTimeField(blank=True, null=True)
      password_changed = models.DateField(blank=True, null=True)
      security_q1 = models.CharField(max_length=255, blank=True, null=True)
      security_q2 = models.CharField(max_length=255, blank=True, null=True)
      security_a1 = models.CharField(max_length=255, blank=True, null=True)
      security_a2 = models.CharField(max_length=255, blank=True, null=True)
      is_superuser = models.IntegerField(db_column='role', blank=False, null=False, default=0)
      login_unlock_date = models.DateTimeField(blank=True, null=True)
      challenge_unlock_date = models.DateTimeField(blank=True, null=True)
      is_active = models.SmallIntegerField(db_column='active', blank=False, null=False, default=0)
      updated = models.DateTimeField(blank=True, null=True)
      date_joined = models.DateTimeField(db_column='created', blank=True, null=True)
      is_staff = models.SmallIntegerField(blank=False, null=False, default=0)
  
      REQUIRED_FIELDS = [
          'first_name',
          'last_name',
          'email',
      ]
      USERNAME_FIELD = 'username'
  
      class Meta:
          db_table = 'Users'
  </code></pre>