From cbdd2aa141fc7c0f82b3667bbc55d50843d6627c Mon Sep 17 00:00:00 2001 From: Ryan Backman Date: Thu, 2 Jun 2016 14:05:49 -0700 Subject: [PATCH] Document Runtime Error when running outside of application context --- docs/appcontext.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/appcontext.rst b/docs/appcontext.rst index 672b6bfd..baa71315 100644 --- a/docs/appcontext.rst +++ b/docs/appcontext.rst @@ -74,6 +74,11 @@ The application context is also used by the :func:`~flask.url_for` function in case a ``SERVER_NAME`` was configured. This allows you to generate URLs even in the absence of a request. +If a request context has not been pushed and an application context has +not been explicitly set, a ``RuntimeError`` will be raised. +:: + RuntimeError: Working outside of application context. + Locality of the Context -----------------------