I have implemented a CustomUser and CustomUserManager in my DRF app. The tutorials I have followed are this one and this one, which are nearly identical approaches to creating a custom user and custom user manager.
I placed a print statement in the create_user and create_superuser methods of the custom user manager to check it was being used correctly.
class MyUserManager(BaseUserManager):
def create_user(self, email, password, **extra_fields):
print("manager used")
...
When I use the command python manage.py addsuperuser
, the print statement runs, great. When I use the built-in admin panel of the DRF framework localhost:8000/admin to create a new admin or regular user, the statement doesn't run, however, the user is created without error.
As far as I can see, the implementation is meant to have the admin panel use the new customer user manager, but that doesn't seem to be the case. What have I done wrong?