我想在 Django 应用程序中添加用户。这是我的代码,它会在这一行中引发异常
user = User.objects.create(userName, userMail, userPass)
这是整个代码:
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(userName, userMail, userPass)
user.save()
return render_to_response('home.html', context_instance=RequestContext(request))
有什么帮助吗?