|
@ -6,57 +6,7 @@ Puedes definir parámetros de Cookie de la misma manera que defines parámetros |
|
|
|
|
|
|
|
|
Primero importa `Cookie`: |
|
|
Primero importa `Cookie`: |
|
|
|
|
|
|
|
|
//// tab | Python 3.10+ |
|
|
{* ../../docs_src/cookie_params/tutorial001_an_py310.py hl[3]*} |
|
|
|
|
|
|
|
|
```Python hl_lines="3" |
|
|
|
|
|
{!> ../../docs_src/cookie_params/tutorial001_an_py310.py!} |
|
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
//// |
|
|
|
|
|
|
|
|
|
|
|
//// tab | Python 3.9+ |
|
|
|
|
|
|
|
|
|
|
|
```Python hl_lines="3" |
|
|
|
|
|
{!> ../../docs_src/cookie_params/tutorial001_an_py39.py!} |
|
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
//// |
|
|
|
|
|
|
|
|
|
|
|
//// tab | Python 3.8+ |
|
|
|
|
|
|
|
|
|
|
|
```Python hl_lines="3" |
|
|
|
|
|
{!> ../../docs_src/cookie_params/tutorial001_an.py!} |
|
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
//// |
|
|
|
|
|
|
|
|
|
|
|
//// tab | Python 3.10+ non-Annotated |
|
|
|
|
|
|
|
|
|
|
|
/// tip | Consejo |
|
|
|
|
|
|
|
|
|
|
|
Es preferible utilizar la versión `Annotated` si es posible. |
|
|
|
|
|
|
|
|
|
|
|
/// |
|
|
|
|
|
|
|
|
|
|
|
```Python hl_lines="1" |
|
|
|
|
|
{!> ../../docs_src/cookie_params/tutorial001_py310.py!} |
|
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
//// |
|
|
|
|
|
|
|
|
|
|
|
//// tab | Python 3.8+ non-Annotated |
|
|
|
|
|
|
|
|
|
|
|
/// tip | Consejo |
|
|
|
|
|
|
|
|
|
|
|
Es preferible utilizar la versión `Annotated` si es posible. |
|
|
|
|
|
|
|
|
|
|
|
/// |
|
|
|
|
|
|
|
|
|
|
|
```Python hl_lines="3" |
|
|
|
|
|
{!> ../../docs_src/cookie_params/tutorial001.py!} |
|
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
//// |
|
|
|
|
|
|
|
|
|
|
|
## Declarar parámetros de `Cookie` |
|
|
## Declarar parámetros de `Cookie` |
|
|
|
|
|
|
|
@ -64,57 +14,7 @@ Luego declara los parámetros de cookie usando la misma estructura que con `Path |
|
|
|
|
|
|
|
|
El primer valor es el valor por defecto, puedes pasar todos los parámetros adicionales de validación o anotación: |
|
|
El primer valor es el valor por defecto, puedes pasar todos los parámetros adicionales de validación o anotación: |
|
|
|
|
|
|
|
|
//// tab | Python 3.10+ |
|
|
{* ../../docs_src/cookie_params/tutorial001_an_py310.py hl[9]*} |
|
|
|
|
|
|
|
|
```Python hl_lines="9" |
|
|
|
|
|
{!> ../../docs_src/cookie_params/tutorial001_an_py310.py!} |
|
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
//// |
|
|
|
|
|
|
|
|
|
|
|
//// tab | Python 3.9+ |
|
|
|
|
|
|
|
|
|
|
|
```Python hl_lines="9" |
|
|
|
|
|
{!> ../../docs_src/cookie_params/tutorial001_an_py39.py!} |
|
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
//// |
|
|
|
|
|
|
|
|
|
|
|
//// tab | Python 3.8+ |
|
|
|
|
|
|
|
|
|
|
|
```Python hl_lines="10" |
|
|
|
|
|
{!> ../../docs_src/cookie_params/tutorial001_an.py!} |
|
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
//// |
|
|
|
|
|
|
|
|
|
|
|
//// tab | Python 3.10+ non-Annotated |
|
|
|
|
|
|
|
|
|
|
|
/// tip | Consejo |
|
|
|
|
|
|
|
|
|
|
|
Es preferible utilizar la versión `Annotated` si es posible. |
|
|
|
|
|
|
|
|
|
|
|
/// |
|
|
|
|
|
|
|
|
|
|
|
```Python hl_lines="7" |
|
|
|
|
|
{!> ../../docs_src/cookie_params/tutorial001_py310.py!} |
|
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
//// |
|
|
|
|
|
|
|
|
|
|
|
//// tab | Python 3.8+ non-Annotated |
|
|
|
|
|
|
|
|
|
|
|
/// tip | Consejo |
|
|
|
|
|
|
|
|
|
|
|
Es preferible utilizar la versión `Annotated` si es posible. |
|
|
|
|
|
|
|
|
|
|
|
/// |
|
|
|
|
|
|
|
|
|
|
|
```Python hl_lines="9" |
|
|
|
|
|
{!> ../../docs_src/cookie_params/tutorial001.py!} |
|
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
//// |
|
|
|
|
|
|
|
|
|
|
|
/// note | "Detalles Técnicos" |
|
|
/// note | "Detalles Técnicos" |
|
|
|
|
|
|
|
|