From 8340d3c9f5cb38f23dd16d7d28aa643a121c4236 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Thu, 25 Aug 2011 21:49:50 +0100 Subject: [PATCH] Updated docstring on make_response --- flask/helpers.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/flask/helpers.py b/flask/helpers.py index a260b03f..d8f7ac63 100644 --- a/flask/helpers.py +++ b/flask/helpers.py @@ -145,6 +145,13 @@ def make_response(*args): response = make_response(render_template('not_found.html'), 404) + The other use case of this function is to force the return value of a + view function into a response which is helpful with view + decorators:: + + response = make_response(view_function()) + response.headers['X-Parachutes'] = 'parachutes are cool' + Internally this function does the following things: - if no arguments are passed, it creates a new response argument