0

Using:

class User(AbstractBaseUser):
    pass #models here

I added extra fields to my custom user model. This table is created successfully in postgres with absolutely no issues, however, whilst creating a superuser the credentials gets pushed to auth_user(default django user table) instead of account_user.

auth_user shouldn't even be created alongside accounts_user?! Even worse:

REQUIRED_FIELDS = ['username', 'first_name', 'last_name']

which I set isn't required at all when creating superuser. It still uses default django configurations/fields. These are in order if you're wondering: AUTH_USER_MODELS = 'accounts.User' and installed 'accounts' in INSTALLED_APPS=[ ]. What is happening?

Superuser credentials should be created in accounts_user table not auth_table in postgreSQL. REQUIRED_FIELDS = ['username', 'first_name', 'last_name'] should be requested whilst creating superuser.

st. Evan
  • 1
  • 1

0 Answers0