1,700 matches across 25 files for func main lang:Markdown
snippet_mode: auto · sorted by relevance
docs/en/docs/advanced/security/index.md MARKDOWN 2 matches view file →
15## Read the Tutorial first { #read-the-tutorial-first }
16
17The next sections assume you already read the main [Tutorial - User Guide: Security](../../tutorial/security/index.md).
18
19They are all based on the same concepts, but allow some extra functionalities.
· · ·
19They are all based on the same concepts, but allow some extra functionalities.
20
docs/en/docs/reference/dependencies.md MARKDOWN 1 matches view file →
3## `Depends()`
4
5Dependencies are handled mainly with the special function `Depends()` that takes a callable.
6
7Here is the reference for it and its parameters.
docs/en/docs/tutorial/testing.md MARKDOWN 18 matches · showing 5 view file →
25Create a `TestClient` by passing your **FastAPI** application to it.
26
27Create functions with a name that starts with `test_` (this is a standard `pytest` convention).
28
29Use the `TestClient` object the same way as you do with `httpx`.
· · ·
35/// tip
36
37Notice that the testing functions are normal `def`, not `async def`.
38
39And the calls to the client are also normal calls, not using `await`.
· · ·
53/// tip
54
55If you want to call `async` functions in your tests apart from sending requests to your FastAPI application (e.g. asynchronous database functions), have a look at the [Async Tests](../advanced/async-tests.md) in the advanced tutorial.
56
57///
· · ·
71├── app
72│   ├── __init__.py
73│   └── main.py
74```
75
· · ·
76In the file `main.py` you have your **FastAPI** app:
77
78
+ 13 more matches in this file
docs/pt/llm-prompt.md MARKDOWN 6 matches · showing 5 view file →
18- Merge repeated words naturally while keeping the meaning.
19- Do **not** introduce extra words to replace repeated phrases unnecessarily.
20- Keep translations fluent and concise, but maintain the original meaning.
21
22**Example:**
· · ·
26
27Avoid translating literally as:
28Vamos ver como isso funciona e como alterar isso se você precisar fazer isso.
29
30Better translation:
· · ·
31Vamos ver como isso funciona e como alterar se você precisar.
32
33---
· · ·
50* bug: bug
51* context manager: gerenciador de contexto
52* cross domain: cross domain (do not translate to "domínio cruzado")
53* cross origin: cross origin (do not translate to "origem cruzada")
54* Cross-Origin Resource Sharing: Cross-Origin Resource Sharing (do not translate to "Compartilhamento de Recursos de Origem Cruzada")
· · ·
60* FastAPI app: aplicação FastAPI
61* framework: framework (do not translate)
62* feature: funcionalidade
63* guides: tutoriais
64* I/O (as in "input and output"): I/O (do not translate to "E/S")
+ 1 more matches in this file
docs/es/docs/tutorial/testing.md MARKDOWN 18 matches · showing 5 view file →
25Crea un `TestClient` pasándole tu aplicación de **FastAPI**.
26
27Crea funciones con un nombre que comience con `test_` (esta es la convención estándar de `pytest`).
28
29Usa el objeto `TestClient` de la misma manera que con `httpx`.
· · ·
35/// tip | Consejo
36
37Nota que las funciones de prueba son `def` normales, no `async def`.
38
39Y las llamadas al cliente también son llamadas normales, sin usar `await`.
· · ·
53/// tip | Consejo
54
55Si quieres llamar a funciones `async` en tus pruebas además de enviar requests a tu aplicación FastAPI (por ejemplo, funciones asincrónicas de bases de datos), echa un vistazo a las [Pruebas Asincrónicas](../advanced/async-tests.md) en el tutorial avanzado.
56
57///
· · ·
71├── app
72│   ├── __init__.py
73│   └── main.py
74```
75
· · ·
76En el archivo `main.py` tienes tu aplicación de **FastAPI**:
77
78
+ 13 more matches in this file
docs/en/docs/advanced/settings.md MARKDOWN 31 matches · showing 5 view file →
80
81```console
82$ ADMIN_EMAIL="deadpool@example.com" APP_NAME="ChimichangApp" fastapi run main.py
83
84<span style="color: green;">INFO</span>: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
· · ·
107{* ../../docs_src/settings/app01_py310/config.py *}
108
109And then use it in a file `main.py`:
110
111{* ../../docs_src/settings/app01_py310/main.py hl[3,11:13] *}
· · ·
111{* ../../docs_src/settings/app01_py310/main.py hl[3,11:13] *}
112
113/// tip
· · ·
131Notice that now we don't create a default instance `settings = Settings()`.
132
133### The main app file { #the-main-app-file }
134
135Now we create a dependency that returns a new `config.Settings()`.
· · ·
136
137{* ../../docs_src/settings/app02_an_py310/main.py hl[6,12:13] *}
138
139/// tip
+ 26 more matches in this file
docs/zh-hant/docs/advanced/settings.md MARKDOWN 24 matches · showing 5 view file →
80
81```console
82$ ADMIN_EMAIL="deadpool@example.com" APP_NAME="ChimichangApp" fastapi run main.py
83
84<span style="color: green;">INFO</span>: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
· · ·
107{* ../../docs_src/settings/app01_py310/config.py *}
108
109然後在 `main.py` 檔案中使用它:
110
111{* ../../docs_src/settings/app01_py310/main.py hl[3,11:13] *}
· · ·
111{* ../../docs_src/settings/app01_py310/main.py hl[3,11:13] *}
112
113/// tip
· · ·
131注意現在我們不再建立預設實例 `settings = Settings()`。
132
133### 主應用程式檔案 { #the-main-app-file }
134
135現在我們建立一個相依,回傳新的 `config.Settings()`。
· · ·
136
137{* ../../docs_src/settings/app02_an_py310/main.py hl[6,12:13] *}
138
139/// tip
+ 19 more matches in this file
docs/es/docs/tutorial/index.md MARKDOWN 8 matches · showing 5 view file →
1# Tutorial - Guía del Usuario { #tutorial-user-guide }
2
3Este tutorial te muestra cómo usar **FastAPI** con la mayoría de sus funcionalidades, paso a paso.
4
5Cada sección se basa gradualmente en las anteriores, pero está estructurada para separar temas, de manera que puedas ir directamente a cualquier sección específica para resolver tus necesidades específicas de API.
· · ·
6
7También está diseñado para funcionar como una referencia futura para que puedas volver y ver exactamente lo que necesitas.
8
9## Ejecuta el código { #run-the-code }
· · ·
11Todos los bloques de código pueden ser copiados y usados directamente (de hecho, son archivos Python probados).
12
13Para ejecutar cualquiera de los ejemplos, copia el código a un archivo `main.py`, y comienza `fastapi dev`:
14
15<div class="termy">
· · ·
24 Importing from <font color="#75507B">/home/user/code/</font><font color="#AD7FA8">awesomeapp</font>
25
26 <span style="background-color:#007166"><font color="#D3D7CF"> module </font></span> 🐍 main.py
27
28 <span style="background-color:#007166"><font color="#D3D7CF"> code </font></span> Importing the FastAPI app object from the module with
· · ·
29 the following code:
30
31 <u style="text-decoration-style:solid">from </u><u style="text-decoration-style:solid"><b>main</b></u><u style="text-decoration-style:solid"> import </u><u style="text-decoration-style:solid"><b>app</b></u>
32
33 <span style="background-color:#007166"><font color="#D3D7CF"> app </font></span> Using import string: <font color="#3465A4">main:app</font>
+ 3 more matches in this file
docs/pt/docs/editor-support.md MARKDOWN 4 matches view file →
7## Configuração e Instalação { #setup-and-installation }
8
9A **FastAPI Extension** está disponível para [VS Code](https://code.visualstudio.com/) e [Cursor](https://www.cursor.com/). Pode ser instalada diretamente pelo painel de Extensões de cada editor, pesquisando por "FastAPI" e selecionando a extensão publicada por **FastAPI Labs**. A extensão também funciona em editores no navegador, como [vscode.dev](https://vscode.dev) e [github.dev](https://github.dev).
10
11### Descoberta da Aplicação { #application-discovery }
· · ·
12
13Por padrão, a extensão descobre automaticamente aplicações FastAPI no seu workspace procurando por arquivos que instanciam `FastAPI()`. Se a detecção automática não funcionar para a estrutura do seu projeto, você pode especificar um ponto de entrada via `[tool.fastapi]` em `pyproject.toml` ou pela configuração `fastapi.entryPoint` do VS Code usando notação de módulo (por exemplo, `myapp.main:app`).
14
15## Funcionalidades { #features }
· · ·
15## Funcionalidades { #features }
16
17- **Explorador de Operações de Rota** - Uma visualização em árvore na barra lateral de todas as <dfn title="rotas, endpoints">*operações de rota*</dfn> da sua aplicação. Clique para ir diretamente a qualquer definição de rota ou de router.
· · ·
21- **Transmitir logs da aplicação** - Transmissão em tempo real dos logs da aplicação implantada no FastAPI Cloud, com filtragem por nível e busca de texto.
22
23Se quiser se familiarizar com as funcionalidades da extensão, você pode abrir o walkthrough da extensão acessando a Paleta de Comandos (<kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>P</kbd> ou no macOS: <kbd>Cmd</kbd> + <kbd>Shift</kbd> + <kbd>P</kbd>), selecionando "Welcome: Open walkthrough..." e, em seguida, escolhendo o walkthrough "Get started with FastAPI".
24
docs/es/docs/editor-support.md MARKDOWN 4 matches view file →
7## Configuración e instalación { #setup-and-installation }
8
9La **Extensión de FastAPI** está disponible tanto para [VS Code](https://code.visualstudio.com/) como para [Cursor](https://www.cursor.com/). Se puede instalar directamente desde el panel de Extensiones en cada editor buscando "FastAPI" y seleccionando la extensión publicada por **FastAPI Labs**. La extensión también funciona en editores basados en navegador como [vscode.dev](https://vscode.dev) y [github.dev](https://github.dev).
10
11### Descubrimiento de la aplicación { #application-discovery }
· · ·
12
13Por defecto, la extensión descubrirá automáticamente aplicaciones FastAPI en tu espacio de trabajo escaneando archivos que crean un instance de `FastAPI()`. Si la detección automática no funciona con la estructura de tu proyecto, puedes especificar un punto de entrada mediante `[tool.fastapi]` en `pyproject.toml` o la configuración de VS Code `fastapi.entryPoint` usando notación de módulo (p. ej. `myapp.main:app`).
14
15## Funcionalidades { #features }
· · ·
15## Funcionalidades { #features }
16
17- **Explorador de Path Operations** - Una vista en árbol en la barra lateral de todas las <dfn title="rutas, endpoints">*path operations*</dfn> de tu aplicación. Haz clic para saltar a cualquier definición de ruta o de router.
· · ·
21- **Streaming de logs de la aplicación** - Streaming en tiempo real de logs desde tu aplicación desplegada en FastAPI Cloud, con filtrado por nivel y búsqueda de texto.
22
23Si quieres familiarizarte con las funcionalidades de la extensión, puedes revisar el recorrido guiado de la extensión abriendo la Paleta de Comandos (<kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>P</kbd> o en macOS: <kbd>Cmd</kbd> + <kbd>Shift</kbd> + <kbd>P</kbd>) y seleccionando "Welcome: Open walkthrough..." y luego eligiendo el recorrido "Get started with FastAPI".
24
docs/zh/docs/advanced/settings.md MARKDOWN 23 matches · showing 5 view file →
80
81```console
82$ ADMIN_EMAIL="deadpool@example.com" APP_NAME="ChimichangApp" fastapi run main.py
83
84<span style="color: green;">INFO</span>: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
· · ·
107{* ../../docs_src/settings/app01_py310/config.py *}
108
109然后在 `main.py` 文件中使用它:
110
111{* ../../docs_src/settings/app01_py310/main.py hl[3,11:13] *}
· · ·
111{* ../../docs_src/settings/app01_py310/main.py hl[3,11:13] *}
112
113/// tip | 提示
· · ·
131注意,现在我们不再创建默认实例 `settings = Settings()`。
132
133### 主应用文件 { #the-main-app-file }
134
135现在我们创建一个依赖项,返回一个新的 `config.Settings()`。
· · ·
136
137{* ../../docs_src/settings/app02_an_py310/main.py hl[6,12:13] *}
138
139/// tip | 提示
+ 18 more matches in this file
docs/en/docs/advanced/stream-data.md MARKDOWN 8 matches · showing 5 view file →
21## A `StreamingResponse` with `yield` { #a-streamingresponse-with-yield }
22
23If you declare a `response_class=StreamingResponse` in your *path operation function*, you can use `yield` to send each chunk of data in turn.
24
25{* ../../docs_src/stream_data/tutorial001_py310.py ln[1:23] hl[20,23] *}
· · ·
27FastAPI will give each chunk of data to the `StreamingResponse` as is, it won't try to convert it to JSON or anything similar.
28
29### Non-async *path operation functions* { #non-async-path-operation-functions }
30
31You can also use regular `def` functions (without `async`), and use `yield` the same way.
· · ·
31You can also use regular `def` functions (without `async`), and use `yield` the same way.
32
33{* ../../docs_src/stream_data/tutorial001_py310.py ln[26:29] hl[27] *}
· · ·
45### Stream Bytes { #stream-bytes }
46
47One of the main use cases would be to stream `bytes` instead of strings, you can of course do it.
48
49{* ../../docs_src/stream_data/tutorial001_py310.py ln[44:47] hl[47] *}
· · ·
59{* ../../docs_src/stream_data/tutorial002_py310.py ln[6,19:20] hl[20] *}
60
61Then you can use this new class in `response_class=PNGStreamingResponse` in your *path operation function*:
62
63{* ../../docs_src/stream_data/tutorial002_py310.py ln[23:27] hl[23] *}
+ 3 more matches in this file
docs/es/docs/advanced/settings.md MARKDOWN 33 matches · showing 5 view file →
53De la misma forma que con los modelos de Pydantic, declaras atributos de clase con anotaciones de tipos, y posiblemente, valores por defecto.
54
55Puedes usar todas las mismas funcionalidades de validación y herramientas que usas para los modelos de Pydantic, como diferentes tipos de datos y validaciones adicionales con `Field()`.
56
57{* ../../docs_src/settings/tutorial001_py310.py hl[2,5:8,11] *}
· · ·
80
81```console
82$ ADMIN_EMAIL="deadpool@example.com" APP_NAME="ChimichangApp" fastapi run main.py
83
84<span style="color: green;">INFO</span>: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
· · ·
107{* ../../docs_src/settings/app01_py310/config.py *}
108
109Y luego usarlo en un archivo `main.py`:
110
111{* ../../docs_src/settings/app01_py310/main.py hl[3,11:13] *}
· · ·
111{* ../../docs_src/settings/app01_py310/main.py hl[3,11:13] *}
112
113/// tip | Consejo
· · ·
131Nota que ahora no creamos un instance por defecto `settings = Settings()`.
132
133### El archivo principal de la app { #the-main-app-file }
134
135Ahora creamos una dependencia que devuelve un nuevo `config.Settings()`.
+ 28 more matches in this file
docs/pt/docs/advanced/settings.md MARKDOWN 25 matches · showing 5 view file →
54Da mesma forma que com modelos do Pydantic, você declara atributos de classe com anotações de tipo e, possivelmente, valores padrão.
55
56Você pode usar as mesmas funcionalidades e ferramentas de validação que usa em modelos do Pydantic, como diferentes tipos de dados e validações adicionais com `Field()`.
57
58{* ../../docs_src/settings/tutorial001_py310.py hl[2,5:8,11] *}
· · ·
81
82```console
83$ ADMIN_EMAIL="deadpool@example.com" APP_NAME="ChimichangApp" fastapi run main.py
84
85<span style="color: green;">INFO</span>: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
· · ·
108{* ../../docs_src/settings/app01_py310/config.py *}
109
110E então usá-lo em um arquivo `main.py`:
111
112{* ../../docs_src/settings/app01_py310/main.py hl[3,11:13] *}
· · ·
112{* ../../docs_src/settings/app01_py310/main.py hl[3,11:13] *}
113
114/// tip | Dica
· · ·
132Perceba que agora não criamos uma instância padrão `settings = Settings()`.
133
134### O arquivo principal da aplicação { #the-main-app-file }
135
136Agora criamos uma dependência que retorna um novo `config.Settings()`.
+ 20 more matches in this file
docs/fr/docs/advanced/settings.md MARKDOWN 25 matches · showing 5 view file →
80
81```console
82$ ADMIN_EMAIL="deadpool@example.com" APP_NAME="ChimichangApp" fastapi run main.py
83
84<span style="color: green;">INFO</span>: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
· · ·
107{* ../../docs_src/settings/app01_py310/config.py *}
108
109Puis l'utiliser dans un fichier `main.py` :
110
111{* ../../docs_src/settings/app01_py310/main.py hl[3,11:13] *}
· · ·
111{* ../../docs_src/settings/app01_py310/main.py hl[3,11:13] *}
112
113/// tip | Astuce
· · ·
129{* ../../docs_src/settings/app02_an_py310/config.py hl[10] *}
130
131Notez que maintenant, nous ne créons pas d'instance par défaut `settings = Settings()`.
132
133### Le fichier principal de l'application { #the-main-app-file }
· · ·
133### Le fichier principal de l'application { #the-main-app-file }
134
135Nous créons maintenant une dépendance qui renvoie un nouveau `config.Settings()`.
+ 20 more matches in this file
docs/en/docs/advanced/path-operation-advanced-configuration.md MARKDOWN 11 matches · showing 5 view file →
15{* ../../docs_src/path_operation_advanced_configuration/tutorial001_py310.py hl[6] *}
16
17### Using the *path operation function* name as the operationId { #using-the-path-operation-function-name-as-the-operationid }
18
19If you want to use your APIs' function names as `operationId`s, you can pass a custom `generate_unique_id_function` to `FastAPI`.
· · ·
19If you want to use your APIs' function names as `operationId`s, you can pass a custom `generate_unique_id_function` to `FastAPI`.
20
21The function receives each `APIRoute` and returns the `operationId` to use for that path operation.
· · ·
21The function receives each `APIRoute` and returns the `operationId` to use for that path operation.
22
23{* ../../docs_src/path_operation_advanced_configuration/tutorial002_py310.py hl[2,5:6,9] *}
· · ·
25/// warning
26
27If you do this, you have to make sure each one of your *path operation functions* has a unique name.
28
29Even if they are in different modules (Python files).
· · ·
39## Advanced description from docstring { #advanced-description-from-docstring }
40
41You can limit the lines used from the docstring of a *path operation function* for OpenAPI.
42
43Adding an `\f` (an escaped "form feed" character) causes **FastAPI** to truncate the output used for OpenAPI at this point.
+ 6 more matches in this file
docs/tr/docs/advanced/settings.md MARKDOWN 24 matches · showing 5 view file →
81
82```console
83$ ADMIN_EMAIL="deadpool@example.com" APP_NAME="ChimichangApp" fastapi run main.py
84
85<span style="color: green;">INFO</span>: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
· · ·
108{* ../../docs_src/settings/app01_py310/config.py *}
109
110Ve ardından bunu `main.py` dosyasında kullanabilirsiniz:
111
112{* ../../docs_src/settings/app01_py310/main.py hl[3,11:13] *}
· · ·
112{* ../../docs_src/settings/app01_py310/main.py hl[3,11:13] *}
113
114/// tip | İpucu
· · ·
132Dikkat edin, artık default bir instance `settings = Settings()` oluşturmuyoruz.
133
134### Ana uygulama dosyası { #the-main-app-file }
135
136Şimdi, yeni bir `config.Settings()` döndüren bir dependency oluşturuyoruz.
· · ·
137
138{* ../../docs_src/settings/app02_an_py310/main.py hl[6,12:13] *}
139
140/// tip | İpucu
+ 19 more matches in this file
docs/ko/docs/advanced/settings.md MARKDOWN 23 matches · showing 5 view file →
81
82```console
83$ ADMIN_EMAIL="deadpool@example.com" APP_NAME="ChimichangApp" fastapi run main.py
84
85<span style="color: green;">INFO</span>: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
· · ·
108{* ../../docs_src/settings/app01_py310/config.py *}
109
110그리고 `main.py` 파일에서 이를 사용합니다:
111
112{* ../../docs_src/settings/app01_py310/main.py hl[3,11:13] *}
· · ·
112{* ../../docs_src/settings/app01_py310/main.py hl[3,11:13] *}
113
114/// tip | 팁
· · ·
132이제는 기본 인스턴스 `settings = Settings()`를 생성하지 않는다는 점에 유의하세요.
133
134### 메인 앱 파일 { #the-main-app-file }
135
136이제 새로운 `config.Settings()`를 반환하는 의존성을 생성합니다.
· · ·
137
138{* ../../docs_src/settings/app02_an_py310/main.py hl[6,12:13] *}
139
140/// tip | 팁
+ 18 more matches in this file
docs/fr/llm-prompt.md MARKDOWN 4 matches view file →
29“Hello Universe”
30"He said: 'Hello'"
31"The module is `__main__`"
32```
33
· · ·
38“Hello Universe”
39"He said: 'Hello'"
40"The module is `__main__`"
41```
42
· · ·
79Do not try to translate everything. In particular, keep common programming terms (e.g. `framework`, `endpoint`, `plug-in`, `payload`).
80
81Keep class names, function names, modules, file names, and CLI commands unchanged.
82
83### List of English terms and their preferred French translations
· · ·
114- path operation: chemin d'accès
115- path operations (plural): chemins d'accès
116- path operation function: fonction de chemin d'accès
117- path operation decorator: décorateur de chemin d'accès
118
docs/en/docs/tutorial/first-steps.md MARKDOWN 26 matches · showing 5 view file →
5{* ../../docs_src/first_steps/tutorial001_py310.py *}
6
7Copy that to a file `main.py`.
8
9Run the live server:
· · ·
20 Importing from <font color="#75507B">/home/user/code/</font><font color="#AD7FA8">awesomeapp</font>
21
22 <span style="background-color:#007166"><font color="#D3D7CF"> module </font></span> 🐍 main.py
23
24 <span style="background-color:#007166"><font color="#D3D7CF"> code </font></span> Importing the FastAPI app object from the module with
· · ·
25 the following code:
26
27 <u style="text-decoration-style:solid">from </u><u style="text-decoration-style:solid"><b>main</b></u><u style="text-decoration-style:solid"> import </u><u style="text-decoration-style:solid"><b>app</b></u>
28
29 <span style="background-color:#007166"><font color="#D3D7CF"> app </font></span> Using import string: <font color="#3465A4">main:app</font>
· · ·
29 <span style="background-color:#007166"><font color="#D3D7CF"> app </font></span> Using import string: <font color="#3465A4">main:app</font>
30
31 <span style="background-color:#007166"><font color="#D3D7CF"> server </font></span> Server started at <font color="#729FCF"><u style="text-decoration-style:solid">http://127.0.0.1:8000</u></font>
· · ·
150```toml
151[tool.fastapi]
152entrypoint = "main:app"
153```
154
+ 21 more matches in this file
docs/hi/docs/tutorial/testing.md MARKDOWN 18 matches · showing 5 view file →
25अपनी **FastAPI** application को इसमें pass करके एक `TestClient` बनाएँ।
26
27ऐसी functions बनाएँ जिनका नाम `test_` से शुरू होता हो (यह एक standard `pytest` convention है)।
28
29`TestClient` object का उपयोग उसी तरह करें जैसे आप `httpx` के साथ करते हैं।
· · ·
35/// tip | टिप
36
37ध्यान दें कि testing functions सामान्य `def` हैं, `async def` नहीं।
38
39और client को की जाने वाली calls भी सामान्य calls हैं, `await` का उपयोग नहीं करतीं।
· · ·
53/// tip | टिप
54
55अगर आप अपनी FastAPI application को requests भेजने के अलावा अपने tests में `async` functions call करना चाहते हैं (जैसे asynchronous database functions), तो advanced tutorial में [Async Tests](../advanced/async-tests.md) देखें।
56
57///
· · ·
71├── app
72│   ├── __init__.py
73│   └── main.py
74```
75
· · ·
76`main.py` file में आपकी **FastAPI** app है:
77
78
+ 13 more matches in this file
docs/ja/docs/advanced/settings.md MARKDOWN 23 matches · showing 5 view file →
80
81```console
82$ ADMIN_EMAIL="deadpool@example.com" APP_NAME="ChimichangApp" fastapi run main.py
83
84<span style="color: green;">INFO</span>: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
· · ·
107{* ../../docs_src/settings/app01_py310/config.py *}
108
109そして、`main.py` というファイルでそれを使います:
110
111{* ../../docs_src/settings/app01_py310/main.py hl[3,11:13] *}
· · ·
111{* ../../docs_src/settings/app01_py310/main.py hl[3,11:13] *}
112
113/// tip | 豆知識
· · ·
131ここでは、デフォルトのインスタンス `settings = Settings()` を作成していないことに注意してください。
132
133### メインアプリファイル { #the-main-app-file }
134
135ここでは、新しい `config.Settings()` を返す依存関係を作成します。
· · ·
136
137{* ../../docs_src/settings/app02_an_py310/main.py hl[6,12:13] *}
138
139/// tip | 豆知識
+ 18 more matches in this file
docs/de/docs/advanced/settings.md MARKDOWN 22 matches · showing 5 view file →
80
81```console
82$ ADMIN_EMAIL="deadpool@example.com" APP_NAME="ChimichangApp" fastapi run main.py
83
84<span style="color: green;">INFO</span>: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
· · ·
107{* ../../docs_src/settings/app01_py310/config.py *}
108
109Und dann verwenden Sie diese in einer Datei `main.py`:
110
111{* ../../docs_src/settings/app01_py310/main.py hl[3,11:13] *}
· · ·
111{* ../../docs_src/settings/app01_py310/main.py hl[3,11:13] *}
112
113/// tip | Tipp
· · ·
131Beachten Sie, dass wir jetzt keine Defaultinstanz `settings = Settings()` erstellen.
132
133### Die Haupt-Anwendungsdatei { #the-main-app-file }
134
135Jetzt erstellen wir eine Abhängigkeit, die ein neues `config.Settings()` zurückgibt.
· · ·
136
137{* ../../docs_src/settings/app02_an_py310/main.py hl[6,12:13] *}
138
139/// tip | Tipp
+ 17 more matches in this file
docs/es/docs/tutorial/first-steps.md MARKDOWN 24 matches · showing 5 view file →
5{* ../../docs_src/first_steps/tutorial001_py310.py *}
6
7Copia eso en un archivo `main.py`.
8
9Ejecuta el servidor en vivo:
· · ·
20 Importing from <font color="#75507B">/home/user/code/</font><font color="#AD7FA8">awesomeapp</font>
21
22 <span style="background-color:#007166"><font color="#D3D7CF"> module </font></span> 🐍 main.py
23
24 <span style="background-color:#007166"><font color="#D3D7CF"> code </font></span> Importing the FastAPI app object from the module with
· · ·
25 the following code:
26
27 <u style="text-decoration-style:solid">from </u><u style="text-decoration-style:solid"><b>main</b></u><u style="text-decoration-style:solid"> import </u><u style="text-decoration-style:solid"><b>app</b></u>
28
29 <span style="background-color:#007166"><font color="#D3D7CF"> app </font></span> Using import string: <font color="#3465A4">main:app</font>
· · ·
29 <span style="background-color:#007166"><font color="#D3D7CF"> app </font></span> Using import string: <font color="#3465A4">main:app</font>
30
31 <span style="background-color:#007166"><font color="#D3D7CF"> server </font></span> Server started at <font color="#729FCF"><u style="text-decoration-style:solid">http://127.0.0.1:8000</u></font>
· · ·
150```toml
151[tool.fastapi]
152entrypoint = "main:app"
153```
154
+ 19 more matches in this file
docs/es/llm-prompt.md MARKDOWN 3 matches view file →
17* autocomplete: autocompletado
18* completion (in the context of autocompletion): autocompletado
19* feature: funcionalidad
20* sponsor: sponsor
21* host (in a podcast): host
· · ·
22* request (as in HTTP request): request
23* response (as in HTTP response): response
24* path operation function: path operation function (do not translate to "función de operación de ruta")
25* path operation: path operation (do not translate to "operación de ruta")
26* path (as in URL path): path (do not translate to "ruta")
· · ·
65* request body: request body (do not translate to "cuerpo de la petición")
66* response body: response body (do not translate to "cuerpo de la respuesta")
67* cross domain: cross domain (do not translate to "dominio cruzado")
68* cross origin: cross origin (do not translate to "origen cruzado")
69* plugin: plugin (do not translate to "complemento" or "extensión")
Search syntax
auth loginboth terms (AND is implicit)
auth OR logineither term
NOT path:vendorexclude matches
"exact phrase"quoted exact match
/func\s+Test/regex
handler~1fuzzy (Levenshtein 1)
file:*_test.gofilename glob
path:pkg/auth/**full path glob
lang:golanguage filter

Search any public repo from your terminal

This page calls POST /api/v1/code_search. Same tool, available over MCP for Claude/Cursor/Copilot.