是否可以将RegistrationFormUniqueEmail与HMAC activation workflow一起使用?
我的 urls.py 如下所示:
ctrl+shift+t
我有一个 app / registration.py
文件from django.conf.urls import url, include
from app.registration import RegistrationViewUniqueEmail
urlpatterns = [
url(r'^accounts/register/$', RegistrationViewUniqueEmail.as_view(), name='registration_register'),
url(r'^accounts/', include('registration.backends.hmac.urls')),
]
我能够完成注册,即用户是在auth_user表中创建的,我无法创建多个具有预期相同电子邮件地址的用户,但我相信在发送身份验证电子邮件时失败。
from registration.backends.hmac.views import RegistrationView
from registration.forms import RegistrationFormUniqueEmail
class RegistrationViewUniqueEmail(RegistrationView):
form_class = RegistrationFormUniqueEmail
有谁知道这里出了什么问题?
答案 0 :(得分:-1)
(seddonym的原始答案here)
唯一要做的就是替换
from registration.backends.default.views import RegistrationView
与
from registration.backends.hmac.views import RegistrationView