当前位置: 首页>>代码示例>>Python>>正文


Python User.username方法代码示例

本文整理汇总了Python中auth.models.User.username方法的典型用法代码示例。如果您正苦于以下问题:Python User.username方法的具体用法?Python User.username怎么用?Python User.username使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在auth.models.User的用法示例。


在下文中一共展示了User.username方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: other_user

# 需要导入模块: from auth.models import User [as 别名]
# 或者: from auth.models.User import username [as 别名]
def other_user():
    from auth.models import User
    user = User()
    user.username = 'Luke_Skywalker'
    user.email = '[email protected]'
    user.password = user.generate_password(password='12345678')
    user.save(commit=True)
    return user
开发者ID:maxnovais,项目名称:flapy_auth,代码行数:10,代码来源:conftest.py

示例2: user

# 需要导入模块: from auth.models import User [as 别名]
# 或者: from auth.models.User import username [as 别名]
def user():
    from auth.models import User
    user = User()
    user.username = 'Darth_Vader'
    user.email = '[email protected]'
    user.password = user.generate_password(password='12345678')
    user.save(commit=True)
    return user
开发者ID:maxnovais,项目名称:flapy_auth,代码行数:10,代码来源:conftest.py

示例3: register_do

# 需要导入模块: from auth.models import User [as 别名]
# 或者: from auth.models.User import username [as 别名]
def register_do(request):
	password = request.GET.get('password')
	password_repeat = request.GET.get('password_repeat')
	if password != password_repeat:
		return HttpResponseRedirect('/auth/register')
	logging.info( password)
	logging.info( password_repeat)

	user = User()
	user.username = request.GET.get('name')
	user.password = request.GET.get('password')
	user.email = request.GET.get('email')
	user.mobile = request.GET.get('mobile')
	user.save()
	return HttpResponseRedirect('/auth/login')
开发者ID:paullzn,项目名称:paullzn,代码行数:17,代码来源:views.py

示例4: login

# 需要导入模块: from auth.models import User [as 别名]
# 或者: from auth.models.User import username [as 别名]
def login():
    password = request.form.get('inputPassword')
    username = request.form.get('inputUsername')
    user = User()
    user.username = username
    user.password = password
    remember = False
    if request.form.get('remember_me') == 'on':
        remember = True
    login_user(user, remember=remember)
    rest = Rest()
    user.other = rest.get('/auth/user')
    # login_user(user, remember=remember)
    if user.other.get('message'):
        flash(user.other.get('message'), 'error')
        logout_user()
    return redirect(request.form.get('request_url'))
开发者ID:emin100,项目名称:barmanUI,代码行数:19,代码来源:controllers.py


注:本文中的auth.models.User.username方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。