My goal is to add non-authentication values to a user. Like, bio, nationality, etc. I am trying to use a custom user model. I am having trouble accessing the values. I can use the new ones I created, but not the original ones like first_name, last_name, email.
my model.py looks like
from django.db import models
from django.contrib.auth.models import AbstractUser
class User(AbstractUser):
bio = models.CharField(max_length=500, blank=True)
phone = models.CharField(max_length=20, blank=True)
Settings.py I added:
AUTH_USER_MODEL = 'publication.User'
INSTALLED_APPS = [
'publication.apps.PublicationConfig,
...
My admin.py:
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from .models import User
admin.site.register(User, UserAdmin)
How to I add bio and nickname to the admin page?
And how do I access first name, email, bio, phone outside in forms and such?
Many thanks.