我将django-registration
应用程序插入到我的项目中,效果很好。新用户可以注册和登录。但是,在我的应用程序中,我想向用户提供完整的个人资料并使用我通过的信息django-registration
。
如何连接来自 django-registration 的信息和我自己的应用程序的用户模型?
from django.contrib.auth.models import models as auth_models
from django.contrib.auth.models import User
class User(User):
username = auth_models.CharField(max_length=100)
description = auth_models.TextField()
picture = auth_models.ImageField(upload_to=something, blank=True, null=True)
location = auth_models.CharField(max_length=200) # please replace with GIS API
email = auth_models.EmailField()
password = auth_models.CharField(max_length=128)
# during registration: did the user click
# the sent activiation link?
is_active = auth_models.BooleanField(default=False)
appear_in_public_ranking = auth_models.BooleanField(default=True)
def __unicode__(self):
return self.username