Add user model

This commit is contained in:
jhyns 2023-05-01 16:20:39 +09:00
parent d3c6eeaedc
commit 57717c9cd1
4 changed files with 18 additions and 5 deletions

View File

@ -118,3 +118,8 @@ STATIC_URL = "static/"
# https://docs.djangoproject.com/en/4.2/ref/settings/#default-auto-field
DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"
# Custom User Model
AUTH_USER_MODEL = "users.User"

View File

@ -1,3 +1,7 @@
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
# Register your models here.
from .models import User
admin.site.register(User, UserAdmin)

View File

@ -1,3 +1,10 @@
from django.contrib.auth.models import AbstractUser
from django.db import models
# Create your models here.
class User(AbstractUser):
nickname = models.CharField(max_length=50)
# remove unnecessary fields
first_name = None
last_name = None

View File

@ -1,3 +0,0 @@
from django.shortcuts import render
# Create your views here.