1
Melodic 2015-03-02 18:53:19 +08:00
没太明白你想怎么开发,是重写flask-login吗?
我暂时只用到了 下面几个函数 current_user, login_user, login_required, logout_user 配合form和数据库,获取/变更用户信息,注册之类的。 |
2
aec4d 2015-03-02 19:52:45 +08:00
|
3
Mirana 2015-03-02 20:17:15 +08:00
自己写不行吗
|
4
iwillhappy1314 2015-03-03 02:02:44 +08:00
为啥不直接用Flask-Security?
|
5
gully 2015-03-03 09:00:47 +08:00
|
6
fork3rt 2015-03-04 11:29:49 +08:00
@app.route("/login", methods=["GET", "POST"])
def login(): form = RegistrationForm(request.form) if request.method == 'POST' and form.validate(): req = form.validate_login() if req['state_code'] == 0: login_user(req['data']) else: flash(req['message']) return redirect('/login') return redirect(request.args.get("next") or url_for("/")) return render_template("user/login.html", form=form) |
7
firldlove 2015-03-04 13:34:14 +08:00
https://github.com/lingthio/Flask-User
you are welcome~ |