Good day Developers I am new to django. I created two models and registered them but I can't access the admin. Please what should I do?

These are the codes for the models.py

from django.db import models
from django.contrib.auth.models import AbstractBaseUser, BaseUserManager

Create your models here.

for normal admin

class MyAccountManager(BaseUserManager):
    def create_user(self, first_name, last_name, username, email, password=None):
        if not email:
            raise ValueError('User must have an email address')

        if not username:
            raise ValueError('User must have username')

        user = self.model(
            email = self.normalize_email(email),
            username = username,
            first_name = first_name,
            last_name = last_name,

        ) 

        user.set_password(password)
        user.save(using = self.db)
        return user

        # for creaating super user

    def create_superuser(self, first_name, last_name, username, email, password):
        user = self.create_user(
            email = self.normalize_email(email),
            username = username,
            password = password,
            first_name = first_name,
            last_name = last_name,

        )


        user.is_Admin = True
        user.is_active = True
        user.is_staff=True
        user.is_superadmin = True
        user.save(using=self._db)





class Account(AbstractBaseUser):
    first_name = models.CharField(max_length=50)
    last_name = models.CharField(max_length=50)
    username = models.CharField(max_length=50, unique=True)
    email =models.EmailField(max_length=50, unique=True)
    phone_number = models.CharField(max_length=50)


    # required
    date_joined = models.DateTimeField(auto_now_add=True)
    last_login = models.DateTimeField(auto_now_add=True)
    is_admin = models.BooleanField(default=False)
    is_staff = models.BooleanField(default=False)
    is_active = models.BooleanField(default=False)
    is_superadmin = models.BooleanField(default=False)


    USERNAME_FIELD = 'email'
    REQUIRED_FIELDS =['username', 'first_name', 'last_name']
    
    # tell account u are using myaccount manager model
    
    
    objects = MyAccountManager()


    def __str__(Self):
        return self.email

    def has_perm(self, perm, obj=None):
       return self.is_admin

    def has_module_perms(self, add_label):
        return True

This is the admin.py

from django.contrib import admin

from .models import Account

Register your models here.


admin.site.register(Account )

Please kindly assist me

This the image of the admin site

Is the account you’re logging on with identified as a superuser?

Note: I see you’ve added a field named is_superadmin. That is not a replacement for is_superuser. You can’t just change the name of a field and expect Django to know how to use it.

Yes, I changed it to is-superuser but it’s still not working.

Please show your corrected Account model and the corrected manager.
Also show your entry from the settings file where you specify that you’re using the model Account and not User.

Also, in your Account model, you have:

but your manager method create_superuser has:

These are not the same - Python variable names are case-sensitive.