0
我将django-registration
应用程序插入到我的项目中,效果很好。新用户可以注册并登录。但是,在我的应用程序中,我想向用户提供完整的配置文件,并使用我通过django-registration
获得的信息。如何将django注册的注册用户链接到我的应用模型?
如何连接django注册信息和我自己的应用程序的用户模型?
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