Django Documentation

4401280

Setup

Create Project

django-admin startproject core .

Create the accounts app

python3 manage.py startapp accounts

models.py

from django.contrib.auth.models import AbstractUser


class User(AbstractUser):
    pass

admin.py

from django.contrib import admin
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
from .models import User


# Register your models here.

@admin.register(User)
class UserAdmin(BaseUserAdmin):
    pass

settings.py

# Custom User Model
AUTH_USER_MODEL = "accounts.User"