Flask Login Reminders

Description

修改Flask框架用户登录成功之后的登录成功通知

Requirement

Add login reminders

Design

  • Login failed message type
  • Login text
  • Signup Link
  • Placeholder for Login filed

Concluding

String Field placeholder

1
2
3
4
5
email = StringField('Email',
validators=[Required(), Length(1, 64), Email()],
render_kw={
'placeholder': 'Testlink register Email'}
)

Redirecting to other URL when on click

1
2
3
4
5
<script>
document.getElementById("sign_up").onclick = function () {
location.href = "http://vipr-testlink.lss.emc.com/testlink/firstLogin.php";
};
</script>

Python Login Manager login message

1
2
3
4
5
6
from flask.ext.login import LoginManager

login_manager = LoginManager()
login_manager.session_protection = 'Strong'
login_manager.login_view = 'auth.login'
login_manager.login_message = 'Please use your Testlink account to login'
0%