我创建注册表:
#urls.py
from django.conf.urls import patterns, url
from django.views.generic import TemplateView
from account.views import Register
urlpatterns = patterns('',
url(r'^register/$', Register.as_view(template_name='account/register.html')),
)
#views.py
from django.views.generic import CreateView
from django.contrib.auth.models import User
class Register(CreateView):
model = User
success_url = '/account/'
我有一个问题:如何添加该电子邮件(现在我必须输入用户名、密码和 2 次时间)。
@edit
如何“修复”密码?当我创建用户(以这种形式)然后转到管理面板时,在用户中我看到“无效的密码格式或未知的哈希算法。”。我怎样才能修复这个?