Running into auth.User swap AttributeError that has bested me

I am at the point of desperation, and have looked at countless tutorials, stackoverflow posts, and can’t seem to resolve this issue. I want to create a custom User Model, but when I try to sign one up, i get hit with the Manager isn't available; 'auth.User' has been swapped for 'account.User' error. I have indeed specified the AUTH_USER_MODEL in I believe I need to implement a User Manager, but I am apparently out of my depth with it.

My full traceback:


Request Method: POST
Request URL:

Django Version: 4.2.4
Python Version: 3.11.4
Installed Applications:
Installed Middleware:

Traceback (most recent call last):
  File "C:\Users\benmc\AppData\Local\Programs\Python\Python311\Lib\site-packages\django\core\handlers\", line 55, in inner
    response = get_response(request)
  File "C:\Users\benmc\AppData\Local\Programs\Python\Python311\Lib\site-packages\django\core\handlers\", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "C:\Users\benmc\source\Django\Enterlinked\.venv\account\", line 18, in sign_up_view
    if form.is_valid():
  File "C:\Users\benmc\AppData\Local\Programs\Python\Python311\Lib\site-packages\django\forms\", line 201, in is_valid
    return self.is_bound and not self.errors
  File "C:\Users\benmc\AppData\Local\Programs\Python\Python311\Lib\site-packages\django\forms\", line 196, in errors
  File "C:\Users\benmc\AppData\Local\Programs\Python\Python311\Lib\site-packages\django\forms\", line 433, in full_clean
  File "C:\Users\benmc\AppData\Local\Programs\Python\Python311\Lib\site-packages\django\forms\", line 448, in _clean_fields
    value = getattr(self, "clean_%s" % name)()
  File "C:\Users\benmc\AppData\Local\Programs\Python\Python311\Lib\site-packages\django\contrib\auth\", line 155, in clean_username
    and self._meta.model.objects.filter(username__iexact=username).exists()
  File "C:\Users\benmc\AppData\Local\Programs\Python\Python311\Lib\site-packages\django\db\models\", line 196, in __get__
    raise AttributeError(

Exception Type: AttributeError at /
Exception Value: Manager isn't available; 'auth.User' has been swapped for 'account.User'

My that causes the traceback:

from django import forms
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth import get_user_model

User = get_user_model()

class UserSignUpForm(UserCreationForm):
    User = get_user_model()
    fields = ("username", "password")
    widgets = {"password":forms.HiddenInput}

My function:

from django.shortcuts import render, get_object_or_404
from django.http import HttpResponse
from django.contrib.auth.forms import UserCreationForm
from .forms import UserSignUpForm
from django.urls import reverse_lazy
from django.views import generic
from . models import User, Talent, Company, Representative, Casting
import audition.models

from django.contrib.auth import get_user_model
User = get_user_model()

def sign_up_view(request):
    form = UserSignUpForm()

    if request.method=="POST":
        if form.is_valid():

    context = {"form":form}
    return render(request, "../templates/registration/signup.html", context)


from typing import Any
from django.db import models
from django.db.models.query import QuerySet
from django.utils.translation import gettext_lazy
from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin, UserManager
from django.contrib.auth.base_user import BaseUserManager

from datetime import datetime
import audition.models 

class CustomUserManager(UserManager):
    def _create_user(self, email, password, **extra_fields):
        if not email:
            raise ValueError("Please provide a valid e-mail address")
        email = self.normalize_email(email)
        user = self.model(email=email, **extra_fields)

        return user
    def create_user(self, email=None, password=None, **extra_fields):
        extra_fields.setdefault('is_staff', False)
        extra_fields.setdefault('is_superuser', False)
        return self._create_user(email, password, **extra_fields)
    def create_superuser(self, email=None, password=None, **extra_fields):
        extra_fields.setdefault('is_staff', True)
        extra_fields.setdefault('is_superuser', True)
        return self._create_user(email, password, **extra_fields)

"""class Address(models.Model):
    street = models.CharField("Street", max_length=1024)
    city = models.CharField("City", max_length=1024)
    province = models.CharField("Province", max_length=1024)
    code = models.CharField("Zip", max_length=10)

    def get_address(self):
        return f"{self.street} {}, {self._state} {self.code} 

class User(AbstractBaseUser, PermissionsMixin):
    objects = CustomUserManager()
    email = models.EmailField(blank=True, default="", unique=True)

    class Role(models.TextChoices):
        TALENT = "TALENT", "Talent"
        REPRESENTATIVE = "REP", "Representative"
        CASTING = "CASTING", "Casting"
        PRODUCTION = "PROD", "Production"
        ADMIN = "ADMIN", "Admin"

    base_role = Role.ADMIN
    role = models.CharField(max_length=10, choices=Role.choices, default=base_role)

    first_name = models.CharField(max_length=255, blank=True, default='')
    USERNAME_FIELD = "email"
    EMAIL_FIELD = "email"
    country_code = models.CharField(max_length=4)
    area_code = models.CharField(max_length=4)
    phone_number = models.CharField(max_length=10)
    mailing_address = Address()"""
    date_of_birth = models.DateField(null=True, blank=True)

    def age(self):
       x= int(( - self.date_of_birth).days / 365.25)
       z = self.date_of_birth
       a = ( - self.date_of_birth).days 
       return int(( - self.date_of_birth).days / 365.25)
    def __str__(self) -> str:
        if self.first_name == None:
            return self.username
        return f"{self.first_name} {self.last_name}"
    def save(self, *args, **kwargs):
        if not
            return super().save(*args, **kwargs)
    class Meta:
        verbose_name_plural = "Users"

If someone please has any idea of what could be the issue, or how I may resolve it please let me know. This has been a few days now and I am beginning to lose hope.

This isn’t a proper definition for a ModelForm. Those attributes you’ve defined belong in the Meta class within the form. See the ModelForm docs.

Since UserCreationForm inherits from BaseUserCreationForm, you may also find it helpful to look at the source for BaseUserCreationForm as an example.