0

我想在 Django 的用户系统模型中创建新字段。我正在关注官方文档,但我不断收到同样的错误:

执行同样的问题:runserver,makemigrations,migrate

到目前为止,我对代码的更改如下:

模型.py:

from django.db import models
from django.contrib.auth.models import AbstractUser
# Create your models here.

class User(AbstractUser):
    bio = models.TextField(max_length=500,blank=True)
    location = models.CharField(max_length=30, blank=True)
    birth_date = models.DateField(null=True, blank=True)

管理员.py

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

admin.site.register(User, UserAdmin)
4

0 回答 0