🌐 Update translations for es (update-outdated) (#14832)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
Sebastián Ramírez 2026-02-05 08:02:22 -08:00 committed by GitHub
parent cae2659678
commit 4fe06cc24a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 32 additions and 24 deletions

View File

@ -2,17 +2,33 @@
Puedes montar aplicaciones WSGI como viste con [Sub Aplicaciones - Mounts](sub-applications.md){.internal-link target=_blank}, [Detrás de un Proxy](behind-a-proxy.md){.internal-link target=_blank}. Puedes montar aplicaciones WSGI como viste con [Sub Aplicaciones - Mounts](sub-applications.md){.internal-link target=_blank}, [Detrás de un Proxy](behind-a-proxy.md){.internal-link target=_blank}.
Para eso, puedes usar `WSGIMiddleware` y usarlo para envolver tu aplicación WSGI, por ejemplo, Flask, Django, etc. Para eso, puedes usar el `WSGIMiddleware` y usarlo para envolver tu aplicación WSGI, por ejemplo, Flask, Django, etc.
## Usando `WSGIMiddleware` { #using-wsgimiddleware } ## Usando `WSGIMiddleware` { #using-wsgimiddleware }
Necesitas importar `WSGIMiddleware`. /// info | Información
Esto requiere instalar `a2wsgi`, por ejemplo con `pip install a2wsgi`.
///
Necesitas importar `WSGIMiddleware` de `a2wsgi`.
Luego envuelve la aplicación WSGI (p. ej., Flask) con el middleware. Luego envuelve la aplicación WSGI (p. ej., Flask) con el middleware.
Y luego móntala bajo un path. Y luego móntala bajo un path.
{* ../../docs_src/wsgi/tutorial001_py39.py hl[2:3,3] *} {* ../../docs_src/wsgi/tutorial001_py39.py hl[1,3,23] *}
/// note | Nota
Anteriormente, se recomendaba usar `WSGIMiddleware` de `fastapi.middleware.wsgi`, pero ahora está deprecado.
Se aconseja usar el paquete `a2wsgi` en su lugar. El uso sigue siendo el mismo.
Solo asegúrate de tener instalado el paquete `a2wsgi` e importar `WSGIMiddleware` correctamente desde `a2wsgi`.
///
## Revisa { #check-it } ## Revisa { #check-it }

View File

@ -145,8 +145,6 @@ Existen otros formatos y herramientas para definir e instalar dependencias de pa
* Crea un archivo `main.py` con: * Crea un archivo `main.py` con:
```Python ```Python
from typing import Union
from fastapi import FastAPI from fastapi import FastAPI
app = FastAPI() app = FastAPI()
@ -158,7 +156,7 @@ def read_root():
@app.get("/items/{item_id}") @app.get("/items/{item_id}")
def read_item(item_id: int, q: Union[str, None] = None): def read_item(item_id: int, q: str | None = None):
return {"item_id": item_id, "q": q} return {"item_id": item_id, "q": q}
``` ```
@ -572,7 +570,7 @@ Si tienes una configuración simple, con un **contenedor único** que luego inic
### Imagen Base de Docker { #base-docker-image } ### Imagen Base de Docker { #base-docker-image }
Solía haber una imagen official de Docker de FastAPI: <a href="https://github.com/tiangolo/uvicorn-gunicorn-fastapi-docker" class="external-link" target="_blank">tiangolo/uvicorn-gunicorn-fastapi-docker</a>. Pero ahora está obsoleta. ⛔️ Solía haber una imagen official de Docker de FastAPI: <a href="https://github.com/tiangolo/uvicorn-gunicorn-fastapi-docker" class="external-link" target="_blank">tiangolo/uvicorn-gunicorn-fastapi</a>. Pero ahora está obsoleta. ⛔️
Probablemente **no** deberías usar esta imagen base de Docker (o cualquier otra similar). Probablemente **no** deberías usar esta imagen base de Docker (o cualquier otra similar).

View File

@ -161,8 +161,6 @@ $ pip install "fastapi[standard]"
Crea un archivo `main.py` con: Crea un archivo `main.py` con:
```Python ```Python
from typing import Union
from fastapi import FastAPI from fastapi import FastAPI
app = FastAPI() app = FastAPI()
@ -174,7 +172,7 @@ def read_root():
@app.get("/items/{item_id}") @app.get("/items/{item_id}")
def read_item(item_id: int, q: Union[str, None] = None): def read_item(item_id: int, q: str | None = None):
return {"item_id": item_id, "q": q} return {"item_id": item_id, "q": q}
``` ```
@ -183,9 +181,7 @@ def read_item(item_id: int, q: Union[str, None] = None):
Si tu código usa `async` / `await`, usa `async def`: Si tu código usa `async` / `await`, usa `async def`:
```Python hl_lines="9 14" ```Python hl_lines="7 12"
from typing import Union
from fastapi import FastAPI from fastapi import FastAPI
app = FastAPI() app = FastAPI()
@ -197,7 +193,7 @@ async def read_root():
@app.get("/items/{item_id}") @app.get("/items/{item_id}")
async def read_item(item_id: int, q: Union[str, None] = None): async def read_item(item_id: int, q: str | None = None):
return {"item_id": item_id, "q": q} return {"item_id": item_id, "q": q}
``` ```
@ -288,9 +284,7 @@ Ahora modifica el archivo `main.py` para recibir un body desde un request `PUT`.
Declara el body usando tipos estándar de Python, gracias a Pydantic. Declara el body usando tipos estándar de Python, gracias a Pydantic.
```Python hl_lines="4 9-12 25-27" ```Python hl_lines="2 7-10 23-25"
from typing import Union
from fastapi import FastAPI from fastapi import FastAPI
from pydantic import BaseModel from pydantic import BaseModel
@ -300,7 +294,7 @@ app = FastAPI()
class Item(BaseModel): class Item(BaseModel):
name: str name: str
price: float price: float
is_offer: Union[bool, None] = None is_offer: bool | None = None
@app.get("/") @app.get("/")
@ -309,7 +303,7 @@ def read_root():
@app.get("/items/{item_id}") @app.get("/items/{item_id}")
def read_item(item_id: int, q: Union[str, None] = None): def read_item(item_id: int, q: str | None = None):
return {"item_id": item_id, "q": q} return {"item_id": item_id, "q": q}

View File

@ -101,13 +101,13 @@ Por supuesto, también puedes declarar parámetros adicionales de query siempre
Como, por defecto, los valores singulares se interpretan como parámetros de query, no tienes que añadir explícitamente un `Query`, solo puedes hacer: Como, por defecto, los valores singulares se interpretan como parámetros de query, no tienes que añadir explícitamente un `Query`, solo puedes hacer:
```Python ```Python
q: Union[str, None] = None q: str | None = None
``` ```
O en Python 3.10 y superior: O en Python 3.9:
```Python ```Python
q: str | None = None q: Union[str, None] = None
``` ```
Por ejemplo: Por ejemplo:

View File

@ -52,7 +52,7 @@ En estos casos, podría tener sentido almacenar las tags en un `Enum`.
Puedes añadir un `summary` y `description`: Puedes añadir un `summary` y `description`:
{* ../../docs_src/path_operation_configuration/tutorial003_py310.py hl[18:19] *} {* ../../docs_src/path_operation_configuration/tutorial003_py310.py hl[17:18] *}
## Descripción desde docstring { #description-from-docstring } ## Descripción desde docstring { #description-from-docstring }
@ -70,7 +70,7 @@ Será usado en la documentación interactiva:
Puedes especificar la descripción del response con el parámetro `response_description`: Puedes especificar la descripción del response con el parámetro `response_description`:
{* ../../docs_src/path_operation_configuration/tutorial005_py310.py hl[19] *} {* ../../docs_src/path_operation_configuration/tutorial005_py310.py hl[18] *}
/// info | Información /// info | Información