目录 Django重写用户模型报错has no attribute 'USERNAME_FIELD' 在重写用户模型时报错:AttributeError: type object 'UserProfile' has no attribute 'USERNAME_FIELD' Django重写用户模型报错has no attribute 'USERNAME_FIELD' 在重写用户模型时报错:AttributeError: type object 'UserProfile' has no attr
from django import forms from django.core.exceptions import ValidationError from jax import models class RegForm(forms.Form): username = forms.CharField( max_length=16, label="用户名", error_messages={ "max_length": "用户名最长16位",
重写一个UserProfile继承自带的AbstractUser # -*- coding: utf-8 -*- from __future__ import unicode_literals from datetime import datetime from django.db import models from django.contrib.auth.models import AbstractUser # Create your models here. class UserProfi