本文整理汇总了Python中models.user.User.create_user方法的典型用法代码示例。如果您正苦于以下问题:Python User.create_user方法的具体用法?Python User.create_user怎么用?Python User.create_user使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.user.User
的用法示例。
在下文中一共展示了User.create_user方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: post
# 需要导入模块: from models.user import User [as 别名]
# 或者: from models.user.User import create_user [as 别名]
def post(self):
email = self.request.get('email'),
User.create_user(email, unique_properties=['email'],
password_raw=self.request.get('password'),
email=email,
name= self.request.get('name'),
image= self.request.get('image'))
示例2: root
# 需要导入模块: from models.user import User [as 别名]
# 或者: from models.user.User import create_user [as 别名]
def root():
username = raw_input("username: ")
password = raw_input("password: ")
repassword = raw_input("repassword: ")
while password != repassword:
print
print u'# 密码不一致,请重新输入'
print
password = raw_input("password: ")
repassword = raw_input("repassword: ")
User.create_user(username, password)
示例3: post
# 需要导入模块: from models.user import User [as 别名]
# 或者: from models.user.User import create_user [as 别名]
def post(self):
b=self.request.get("name")
self.response.write(b)
d=self.request.get("uname")
print d
f = self.request.get("upname")
print f
a=User.create_user(b)
self.response.write(a)
if b == a:
self.response.write("already exists")
else:
self.response.write("created")
User.create(b)
c=User.listofusers()
if d == a:
e=User.deleteuser(d)
print "deleted user"
else:
print "username didnt exist"
if b == a:
g=User.update(f)
print "updated"
示例4: post
# 需要导入模块: from models.user import User [as 别名]
# 或者: from models.user.User import create_user [as 别名]
def post(self):
form = SignupForm(self.request.POST)
error_message = ""
if form.validate():
auth_id = 'own:' + form.username.data
ok, user = User.create_user(auth_id, username=form.username.data, password_raw=form.password.data)
if ok:
self.login_user(user)
return self.redirect(self.uri_for('profile'))
else:
return self.redirect('/', error_message='Sign Up Error')
示例5: post
# 需要导入模块: from models.user import User [as 别名]
# 或者: from models.user.User import create_user [as 别名]
def post(self):
"""
An example how to use 'csrf' decorator.
We can also use CSRF within WTForms.
"""
form = SignupForm(self.request.POST)
error_message = ""
if form.validate() and not self.auth.get_user_by_session():
auth_id = 'own:{0}'.format(form.username.data)
ok, new_user = User.create_user(auth_id, username=form.username.data, password_raw=form.password.data)
if ok:
logging.debug('New User Created')
self.login_user(new_user)
else:
error_message = "Username dulplicated."
return self.render('index', form=form, error_message=error_message)
示例6: save
# 需要导入模块: from models.user import User [as 别名]
# 或者: from models.user.User import create_user [as 别名]
def save(self):
return User.create_user(self.username.data, self.password.data)