首先,在models.py中創(chuàng)建UserModels類
目前創(chuàng)新互聯(lián)公司已為千余家的企業(yè)提供了網(wǎng)站建設、域名、雅安服務器托管、網(wǎng)站運營、企業(yè)網(wǎng)站設計、平?jīng)鼍W(wǎng)站維護等服務,公司將堅持客戶導向、應用為本的策略,正道將秉承"和諧、參與、激情"的文化,與客戶和合作伙伴齊心協(xié)力一起成長,共同發(fā)展。from django.db import models from django.contrib.auth.models import AbstractUser class UserModels(AbstractUser): nickname = models.CharField(max_length=50, null=True, verbose_name='用戶昵稱') mobile = models.CharField(max_length=11, null=True, verbose_name='電話') address = models.CharField(max_length=100, null=True, verbose_name='住址') sex = models.CharField(max_length=10, null=True, verbose_name='性別') head_img = models.ImageField(upload_to='%Y/%m', verbose_name='頭像', null=True) class Meta: db_table = 'user' verbose_name = '用戶' verbose_name_plural = verbose_name