url_for
Generate a URL to the given endpoint with the given values.
def url_for(
endpoint: str,
_anchor: str | None = None,
_method: str | None = None,
_scheme: str | None = None,
_external: bool | None = None,
values: t.Any
) - > str
Generate a URL to the given endpoint with the given values. This requires an active request or application context, and calls current_app.url_for(). See that method for full documentation.
Parameters
| Name | Type | Description |
|---|---|---|
| endpoint | str | The endpoint name associated with the URL to generate. If this starts with a ".", the current blueprint name (if any) will be used. |
| _anchor | `str | None` = None |
| _method | `str | None` = None |
| _scheme | `str | None` = None |
| _external | `bool | None` = None |
| values | t.Any | Values to use for the variable parts of the URL rule. Unknown keys are appended as query string arguments, like ?a=b&c=d. |
Returns
| Type | Description |
|---|---|
str | The generated URL string. |