1
我想在Django中扩展model.User(使用SQLite3)。这里是我的用户配置文件模型:Django扩展模型。用户
class UserProfile(models.Model):
user = models.ForeignKey(User, unique = True, related_name = 'user')
bio = models.TextField(blank = True, null = True)
birth_date = models.DateField(blank = True, null = True)
followers = models.ManyToManyField('self', symmetrical=False, null = True, blank = True)
但是,当我运行服务器时,我没有看到UserProfiles作为单独的选项卡。有一个用户标签,但我没有看到我的任何自定义字段。我做错了什么或者这是Django的预期行为?我怎么能测试这么多的代码(手动很好,但怎么做?),只是为了看看行为是否如预期。
非常感谢!
的标签?你的意思是管理员标签? – levi
我的意思是超链接!默认情况下,超链接指向User和Group,但UserProfiles看不到一个! –
超链接究竟在哪里? – levi