mirror of https://github.com/pallets/flask.git
Merge pull request #3244 from paulgb/master
Clarify documentation about how url_for uses configuration values (#2759)
This commit is contained in:
commit
b61cbf8ab4
|
@ -276,7 +276,10 @@ The following configuration values are used internally by Flask:
|
||||||
.. py:data:: APPLICATION_ROOT
|
.. py:data:: APPLICATION_ROOT
|
||||||
|
|
||||||
Inform the application what path it is mounted under by the application /
|
Inform the application what path it is mounted under by the application /
|
||||||
web server.
|
web server. This is used for generating URLs outside the context of a
|
||||||
|
request (inside a request, the dispatcher is responsible for setting
|
||||||
|
``SCRIPT_NAME`` instead; see :ref:`Application Dispatching <app-dispatch>`
|
||||||
|
for examples of dispatch configuration).
|
||||||
|
|
||||||
Will be used for the session cookie path if ``SESSION_COOKIE_PATH`` is not
|
Will be used for the session cookie path if ``SESSION_COOKIE_PATH`` is not
|
||||||
set.
|
set.
|
||||||
|
|
|
@ -230,6 +230,9 @@ def url_for(endpoint, **values):
|
||||||
|
|
||||||
For more information, head over to the :ref:`Quickstart <url-building>`.
|
For more information, head over to the :ref:`Quickstart <url-building>`.
|
||||||
|
|
||||||
|
Configuration values ``APPLICATION_ROOT`` and ``SERVER_NAME`` are only used when
|
||||||
|
generating URLs outside of a request context.
|
||||||
|
|
||||||
To integrate applications, :class:`Flask` has a hook to intercept URL build
|
To integrate applications, :class:`Flask` has a hook to intercept URL build
|
||||||
errors through :attr:`Flask.url_build_error_handlers`. The `url_for`
|
errors through :attr:`Flask.url_build_error_handlers`. The `url_for`
|
||||||
function results in a :exc:`~werkzeug.routing.BuildError` when the current
|
function results in a :exc:`~werkzeug.routing.BuildError` when the current
|
||||||
|
|
Loading…
Reference in New Issue