django建用户表的时候一直报错 10
这个是报错信息django.db.models.fields.related_descriptors.RelatedObjectDoesNotExist:Userhasn...
这个是报错信息
django.db.models.fields.related_descriptors.RelatedObjectDoesNotExist: User has no userprofile.
----------------------------------------------------------------
这个是表结构
class UserProfile(models.Model):
user = models.OneToOneField(User)
name =models.CharField(max_length=32)
signature= models.CharField(max_length=255,blank=True,null=True)
head_img = models.ImageField(height_field=150,width_field=150,blank=True,null=True) 展开
django.db.models.fields.related_descriptors.RelatedObjectDoesNotExist: User has no userprofile.
----------------------------------------------------------------
这个是表结构
class UserProfile(models.Model):
user = models.OneToOneField(User)
name =models.CharField(max_length=32)
signature= models.CharField(max_length=255,blank=True,null=True)
head_img = models.ImageField(height_field=150,width_field=150,blank=True,null=True) 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询