From e75322206d2fd1c483494fea7bfba367cdcdd9b2 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Thu, 1 Jul 2010 00:19:32 +0200 Subject: [PATCH] Fixed a broken example in the docs --- docs/quickstart.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/quickstart.rst b/docs/quickstart.rst index 11b0cd84..fd9b02c2 100644 --- a/docs/quickstart.rst +++ b/docs/quickstart.rst @@ -628,7 +628,9 @@ unless he knows the secret key used for signing. In order to use sessions you have to set a secret key. Here is how sessions work:: - from flask import session, redirect, url_for, escape + from flask import Flask, session, redirect, url_for, escape, request + + app = Flask(__name__) @app.route('/') def index(): @@ -652,6 +654,7 @@ sessions work:: def logout(): # remove the username from the session if its there session.pop('username', None) + return redirect(url_for('index')) # set the secret key. keep this really secret: app.secret_key = 'A0Zr98j/3yX R~XHH!jmN]LWX/,?RT'