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