本文整理汇总了Python中src.models.user.User.login方法的典型用法代码示例。如果您正苦于以下问题:Python User.login方法的具体用法?Python User.login怎么用?Python User.login使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类src.models.user.User
的用法示例。
在下文中一共展示了User.login方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: login
# 需要导入模块: from src.models.user import User [as 别名]
# 或者: from src.models.user.User import login [as 别名]
def login():
email = request.form['email']
password = request.form['password']
if User.login_valid(email, password):
User.login(email)
else:
session['email'] = None
return render_template("profile.html", email=session['email'])
示例2: login_user
# 需要导入模块: from src.models.user import User [as 别名]
# 或者: from src.models.user.User import login [as 别名]
def login_user():
email = request.form['email']
password = request.form['password']
if User.login_valid(email, password):
print('user verified')
User.login(email)
else:
session['email'] = None
print('session email', session['email'])
return render_template('profile.html', email=session['email'])
示例3: login_user
# 需要导入模块: from src.models.user import User [as 别名]
# 或者: from src.models.user.User import login [as 别名]
def login_user():
email = request.form['email']
password = request.form['password']
if User.login_valid(email, password):
User.login(email)
else:
session['email'] = None
return render_template('login.html',
failed_login=True) # check if variable check_login is passed, other wise do not display error message
return render_template("profile.html", email=session['email'])
示例4: login_user
# 需要导入模块: from src.models.user import User [as 别名]
# 或者: from src.models.user.User import login [as 别名]
def login_user():
email=request.form['email']
password=request.form['password']
if User.login_valid(email,password):
User.login(email)
else:
session['email']=None
print('Wrong Details')
return render_template("login.html",email=session['email'])
return render_template("choice.html",email=session['email'])
示例5: login_userapp
# 需要导入模块: from src.models.user import User [as 别名]
# 或者: from src.models.user.User import login [as 别名]
def login_userapp():
email=request.form['email']
password=request.form['password']
if User.login_valid(email,password):
User.login(email)
print('Correct Details')
else:
session['email']=None
print('Wrong Details')
return jsonify({"status":"success"})
示例6: login_user
# 需要导入模块: from src.models.user import User [as 别名]
# 或者: from src.models.user.User import login [as 别名]
def login_user():
email=request.form['email']
password=request.form['password']
if (email is "") or (password is ""):
flash("Please fill email id and password")
return render_template('login.html')
if User.login_valid(email,password):
User.login(email)
else:
flash("Invalid credentials")
session['email']=None
return render_template('login.html')
return render_template('profile.html',email=session['email'])