I have been trying to figure this out for a few hours and feel lost. I am new to django and have tried to create a custom user model. My struggle is that my user model won't show up under the Authentication and Authorization section of the admin page. Admin page pic
Here is my code for the model
from django.db import models
from django.contrib.auth.models import AbstractUser
# Create your models here.
class User(AbstractUser):
first_name = models.TextField(max_length = 300)
last_name = models.TextField(max_length = 300)
Here is the code for my admin.py file
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from orders.models import User
# Register your models here.
admin.site.register(User,UserAdmin)
here is a snippet of my settings.py file where i added the AUTH_USER_MODEL
AUTH_USER_MODEL='orders.User'
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'orders'
]
class Meta: app_label = 'auth'
But then i get an ImproperlyConfigured error. – WidnerAUTH_USER_MODEL = 'applicationName.CustomUserClassName'
on your settings.py – Vesture