Add user model
This commit is contained in:
parent
d3c6eeaedc
commit
57717c9cd1
@ -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"
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
@ -1,3 +0,0 @@
|
||||
from django.shortcuts import render
|
||||
|
||||
# Create your views here.
|
Loading…
Reference in New Issue
Block a user