我正在使用Django 1.5的自定义用户配置文件,并且我尝试使用最新的django-registration版本但是在运行sync命令时我总是遇到错误。
CommandError: One or more models did not validate:
registration.registrationprofile: 'user' defines a relation with the model 'auth.User', which has been swapped out. Update the relation to point at settings.AUTH_USER_MODEL.
型号:
class UserProfile(AbstractBaseUser):
username = models.CharField(max_length=140)
email = models.EmailField(
verbose_name='email address',
max_length=254,
unique=True,
db_index=True,
)
设定:
AUTH_USER_MODEL = 'gofindwhat_app.UserProfile'
答案 0 :(得分:2)
奥尔加,第一,我必须做这个改变: https://bitbucket.org/prjts/django-registration/commits/ba31fc3053bfca7eb7a19d912882e50e295adc55
第二,我必须根据默认后端创建自己的后端。