Quantcast
Channel: 一言多いプログラマーの独り言
Viewing all articles
Browse latest Browse all 846

Python+Flask(Flaskr)で、ログアウト

$
0
0
Python+Flask(Flaskr)で、ログアウトです。 これは、セッションを破棄するだけなので、簡単です。


# ログアウト
@app.route('/logout')
def logout():
session.pop('logged_in', None)
flash(u'ログアウトしました', 'info')
return redirect(url_for('index'))

実際に設定してみたのがこちら

参考サイト
Flaskのチュートリアルをやってみる① 〜環境設定からデータベースまで([[ともっくす alloc] init]さん)
Login and Logout

Viewing all articles
Browse latest Browse all 846

Latest Images

Trending Articles