mirror of https://github.com/tiangolo/fastapi.git
Update other highlighting sections
This commit is contained in:
parent
cb3ed45236
commit
1ea085e513
|
|
@ -118,7 +118,7 @@ Danach könnte Ihre Dateistruktur wie folgt aussehen:
|
|||
* Importieren Sie `StaticFiles`.
|
||||
* „Mounten“ Sie eine `StaticFiles()`-Instanz in einem bestimmten Pfad.
|
||||
|
||||
{* ../../docs_src/custom_docs_ui/tutorial002.py hl[7,11] *}
|
||||
{* ../../docs_src/custom_docs_ui/tutorial002.py hl[9,15] *}
|
||||
|
||||
### Die statischen Dateien testen
|
||||
|
||||
|
|
@ -144,7 +144,7 @@ Wie bei der Verwendung eines benutzerdefinierten CDN besteht der erste Schritt d
|
|||
|
||||
Um diese zu deaktivieren, setzen Sie deren URLs beim Erstellen Ihrer `FastAPI`-App auf `None`:
|
||||
|
||||
{* ../../docs_src/custom_docs_ui/tutorial002.py hl[9] *}
|
||||
{* ../../docs_src/custom_docs_ui/tutorial002.py hl[13] *}
|
||||
|
||||
### Die benutzerdefinierten Dokumentationen, mit statischen Dateien, hinzufügen
|
||||
|
||||
|
|
@ -160,7 +160,7 @@ Auch hier können Sie die internen Funktionen von FastAPI wiederverwenden, um di
|
|||
|
||||
Und genau so für ReDoc ...
|
||||
|
||||
{* ../../docs_src/custom_docs_ui/tutorial002.py hl[2:6,14:22,25:27,30:36] *}
|
||||
{* ../../docs_src/custom_docs_ui/tutorial002.py hl[4:8,18:27,30:32,35:42] *}
|
||||
|
||||
/// tip | Tipp
|
||||
|
||||
|
|
@ -176,7 +176,7 @@ Swagger UI erledigt das hinter den Kulissen für Sie, benötigt aber diesen „U
|
|||
|
||||
Um nun testen zu können, ob alles funktioniert, erstellen Sie eine *Pfadoperation*:
|
||||
|
||||
{* ../../docs_src/custom_docs_ui/tutorial002.py hl[39:41] *}
|
||||
{* ../../docs_src/custom_docs_ui/tutorial002.py hl[45:47] *}
|
||||
|
||||
### Benutzeroberfläche, mit statischen Dateien, testen
|
||||
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ Después de eso, tu estructura de archivos podría verse así:
|
|||
* Importa `StaticFiles`.
|
||||
* "Monta" una instance de `StaticFiles()` en un path específico.
|
||||
|
||||
{* ../../docs_src/custom_docs_ui/tutorial002.py hl[7,11] *}
|
||||
{* ../../docs_src/custom_docs_ui/tutorial002.py hl[9,15] *}
|
||||
|
||||
### Prueba los archivos estáticos
|
||||
|
||||
|
|
@ -144,7 +144,7 @@ Igual que cuando usas un CDN personalizado, el primer paso es desactivar la docu
|
|||
|
||||
Para desactivarlos, establece sus URLs en `None` cuando crees tu aplicación de `FastAPI`:
|
||||
|
||||
{* ../../docs_src/custom_docs_ui/tutorial002.py hl[9] *}
|
||||
{* ../../docs_src/custom_docs_ui/tutorial002.py hl[13] *}
|
||||
|
||||
### Incluye la documentación personalizada para archivos estáticos
|
||||
|
||||
|
|
@ -160,7 +160,7 @@ Nuevamente, puedes reutilizar las funciones internas de FastAPI para crear las p
|
|||
|
||||
Y de manera similar para ReDoc...
|
||||
|
||||
{* ../../docs_src/custom_docs_ui/tutorial002.py hl[2:6,14:22,25:27,30:36] *}
|
||||
{* ../../docs_src/custom_docs_ui/tutorial002.py hl[4:8,18:27,30:32,35:42] *}
|
||||
|
||||
/// tip | Consejo
|
||||
|
||||
|
|
@ -176,7 +176,7 @@ Swagger UI lo manejará detrás de escena para ti, pero necesita este auxiliar d
|
|||
|
||||
Ahora, para poder probar que todo funciona, crea una *path operation*:
|
||||
|
||||
{* ../../docs_src/custom_docs_ui/tutorial002.py hl[39:41] *}
|
||||
{* ../../docs_src/custom_docs_ui/tutorial002.py hl[45:47] *}
|
||||
|
||||
### Prueba la UI de Archivos Estáticos
|
||||
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ Depois disso, sua estrutura de arquivos deve se parecer com:
|
|||
* Importe `StaticFiles`.
|
||||
* "Monte" a instância `StaticFiles()` em um caminho específico.
|
||||
|
||||
{* ../../docs_src/custom_docs_ui/tutorial002.py hl[7,11] *}
|
||||
{* ../../docs_src/custom_docs_ui/tutorial002.py hl[9,15] *}
|
||||
|
||||
### Teste os arquivos estáticos
|
||||
|
||||
|
|
@ -144,7 +144,7 @@ Da mesma forma que ao usar um CDN personalizado, o primeiro passo é desativar a
|
|||
|
||||
Para desativá-los, defina suas URLs como `None` ao criar seu aplicativo `FastAPI`:
|
||||
|
||||
{* ../../docs_src/custom_docs_ui/tutorial002.py hl[9] *}
|
||||
{* ../../docs_src/custom_docs_ui/tutorial002.py hl[13] *}
|
||||
|
||||
### Incluir a documentação personalizada para arquivos estáticos
|
||||
|
||||
|
|
@ -160,7 +160,7 @@ Novamente, você pode reutilizar as funções internas do FastAPI para criar as
|
|||
|
||||
E de forma semelhante para o ReDoc...
|
||||
|
||||
{* ../../docs_src/custom_docs_ui/tutorial002.py hl[2:6,14:22,25:27,30:36] *}
|
||||
{* ../../docs_src/custom_docs_ui/tutorial002.py hl[4:8,18:27,30:32,35:42] *}
|
||||
|
||||
/// tip | Dica
|
||||
|
||||
|
|
@ -176,7 +176,7 @@ Swagger UI lidará com isso nos bastidores para você, mas ele precisa desse aux
|
|||
|
||||
Agora, para poder testar se tudo funciona, crie uma *operação de rota*:
|
||||
|
||||
{* ../../docs_src/custom_docs_ui/tutorial002.py hl[39:41] *}
|
||||
{* ../../docs_src/custom_docs_ui/tutorial002.py hl[45:47] *}
|
||||
|
||||
### Teste a UI de Arquivos Estáticos
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue