在我的应用程序中,我将 AUTH_PROFILE_MODULE
设置为 users.UserProfile
。这个 UserProfile 有一个名为 create
的函数,当新用户注册时应该调用它,并创建 UserProfile 条目。
根据 Django 注册文档,我只需要在我的 urls.py 中设置 profile_callback
条目即可。我的代码如下:
url(r'^register/$', register, {'form_class': RecaptchaRegistrationForm,
'profile_callback': UserProfile.objects.create,
'backend': 'registration.backends.default.DefaultBackend',},
name='registration_register')
但我遇到了这个错误:
异常值:register()得到一个意外的关键字参数'profile_callback'
那么我需要把它放在哪里才能使它工作?