title: Django 1.6 AbstractUser not working
body: <p>Trying to create my custom user model, this is the code I have:</p>
  
  <p>models.py</p>
  
  <pre><code>class CustomUser(AbstractUser):
      USERNAME_FIELD = 'email'
  
  CustomUser._meta.get_field_by_name('email')[0]._unique=True
  </code></pre>
  
  <p>settings.py</p>
  
  <pre><code>AUTH_USER_MODEL = 'myapp.CustomUser'
  </code></pre>
  
  <p>When doing the manage.py syncdb, the following error occurs:</p>
  
  <pre><code>CommandError: One or more models did not validate:
  myapp.customuser: The field named as the USERNAME_FIELD should not be included in REQUIRED_FIELDS on a swappable User model.
  </code></pre>
  
  <p>Can anyone shed some light? Is there a better way of customizing the user model in Django 1.6 without rewriting the entire class extending AbstractBaseUser?</p>
  
  <p>Btw, if I delete USERNAME_FIELD = 'email' from my code and change the core django auth/models.py >> AbstractUser definition, it works. I just can't seem to be able to override the USERNAME_FIELD...</p>
  
  <p>Thanks!</p>