本文整理汇总了Python中models.Account.create_user方法的典型用法代码示例。如果您正苦于以下问题:Python Account.create_user方法的具体用法?Python Account.create_user怎么用?Python Account.create_user使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.Account
的用法示例。
在下文中一共展示了Account.create_user方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: register
# 需要导入模块: from models import Account [as 别名]
# 或者: from models.Account import create_user [as 别名]
def register(request):
userName=request.GET['username']
passWord=request.GET['password']
test=Account.create_user(userName, passWord)
test.portrait=open("tmp\\zh.jpg","rb")
test.save()
return HttpResponse(str(test.to_mongo()))
示例2: register
# 需要导入模块: from models import Account [as 别名]
# 或者: from models.Account import create_user [as 别名]
def register(request):
"""
register page and register handle
"""
#TODO user authentication
if request.method == 'GET':
return RTR("register.html", {}, context_instance = RC(request))
else:
user_params = {
'nickname' : request.POST.get('nickname', ''),
'realname' : request.POST.get('real_name', ''),
'password' : request.POST.get('password', ''),
'dept' : request.POST.get('dept', ''),
'intro' : request.POST.get('intro', ''),
'address' : request.POST.get('address', ''),
'email' : request.POST.get('email', ''),
'qq' : request.POST.get('qq', ''),
'phone' : request.POST.get('phone', '')}
Account.create_user(user_params)
return HttpResponse("register_ok.html!!!", {})