我正在尝试通过以下代码在Django项目中创建新用户,但突出显示的行会引发异常。
def createUser(request):
userName = request.REQUEST.get('username', None)
userPass = request.REQUEST.get('password', None)
userMail = request.REQUEST.get('email', None)
# TODO: check if already existed
**user = User.objects.create_user(userName, userMail, userPass)**
user.save()
return render_to_response('home.html', context_instance=RequestContext(request))
有什么帮助吗?