Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 23 for global (0.15 sec)

  1. docs/en/docs/tutorial/bigger-applications.md

    ### Import `FastAPI`
    
    You import and create a `FastAPI` class as normally.
    
    And we can even declare [global dependencies](dependencies/global-dependencies.md){.internal-link target=_blank} that will be combined with the dependencies for each `APIRouter`:
    
    ```Python hl_lines="1  3  7" title="app/main.py"
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 18.6K bytes
    - Viewed (0)
  2. docs/en/docs/contributing.md

    If you create a Python file that imports and uses FastAPI, and run it with the Python from your local environment, it will use your cloned local FastAPI source code.
    
    And if you update that local FastAPI source code when you run that Python file again, it will use the fresh version of FastAPI you just edited.
    
    That way, you don't have to "install" your local version to be able to test every change.
    
    !!! note "Technical Details"
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Jan 11 17:42:43 GMT 2024
    - 14.1K bytes
    - Viewed (0)
  3. docs/zh/docs/tutorial/bigger-applications.md

    在这里你导入并使用 `FastAPI` 类。
    
    这将是你的应用程序中将所有内容联结在一起的主文件。
    
    并且由于你的大部分逻辑现在都存在于其自己的特定模块中,因此主文件的内容将非常简单。
    
    ### 导入 `FastAPI`
    
    你可以像平常一样导入并创建一个 `FastAPI` 类。
    
    我们甚至可以声明[全局依赖项](dependencies/global-dependencies.md){.internal-link target=_blank},它会和每个 `APIRouter` 的依赖项组合在一起:
    
    ```Python hl_lines="1  3  7" title="app/main.py"
    {!../../../docs_src/bigger_applications/app/main.py!}
    ```
    
    ### 导入 `APIRouter`
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 18.5K bytes
    - Viewed (0)
  4. docs/en/docs/advanced/generate-clients.md

    ---> 100%
    ```
    
    </div>
    
    #### Generate Client Code
    
    To generate the client code you can use the command line application `openapi-ts` that would now be installed.
    
    Because it is installed in the local project, you probably wouldn't be able to call that command directly, but you would put it on your `package.json` file.
    
    It could look like this:
    
    ```JSON  hl_lines="7"
    {
      "name": "frontend-app",
      "version": "1.0.0",
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 10.5K bytes
    - Viewed (0)
  5. docs/en/docs/tutorial/first-steps.md

    </div>
    
    In the output, there's a line with something like:
    
    ```hl_lines="4"
    INFO:     Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
    ```
    
    That line shows the URL where your app is being served, in your local machine.
    
    ### Check it
    
    Open your browser at <a href="http://127.0.0.1:8000" class="external-link" target="_blank">http://127.0.0.1:8000</a>.
    
    You will see the JSON response as:
    
    ```JSON
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu May 02 22:37:31 GMT 2024
    - 12K bytes
    - Viewed (0)
  6. docs/pt/docs/tutorial/handling-errors.md

    Digamos que você tenha uma exceção customizada `UnicornException` que você (ou uma biblioteca que você use) precise lançar (`raise`).
    
    Nesse cenário, se você precisa manipular essa exceção de modo global com o FastAPI, você pode adicionar um manipulador de exceção customizada com `@app.exception_handler()`.
    
    ```Python hl_lines="5-7  13-18  24"
    {!../../../docs_src/handling_errors/tutorial003.py!}
    ```
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 10K bytes
    - Viewed (0)
  7. docs/de/docs/tutorial/handling-errors.md

    Nehmen wir an, Sie haben eine benutzerdefinierte Exception `UnicornException`, die Sie (oder eine Bibliothek, die Sie verwenden) `raise`n könnten.
    
    Und Sie möchten diese Exception global mit FastAPI handhaben.
    
    Sie könnten einen benutzerdefinierten Exceptionhandler mittels `@app.exception_handler()` hinzufügen:
    
    ```Python hl_lines="5-7  13-18  24"
    {!../../../docs_src/handling_errors/tutorial003.py!}
    ```
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 30 20:28:29 GMT 2024
    - 10.6K bytes
    - Viewed (0)
  8. docs/en/docs/advanced/settings.md

    ## Settings in a dependency
    
    In some occasions it might be useful to provide the settings from a dependency, instead of having a global object with `settings` that is used everywhere.
    
    This could be especially useful during testing, as it's very easy to override a dependency with your own custom settings.
    
    ### The config file
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu May 02 22:37:31 GMT 2024
    - 15.7K bytes
    - Viewed (0)
  9. docs/de/docs/contributing.md

        Dadurch wird sichergestellt, dass Sie, wenn Sie ein von diesem Package installiertes Terminalprogramm verwenden, das Programm aus Ihrer lokalen Umgebung verwenden und kein anderes, das global installiert sein könnte.
    
    ### Benötigtes mit pip installieren
    
    Nachdem Sie die Umgebung wie oben beschrieben aktiviert haben:
    
    <div class="termy">
    
    ```console
    $ pip install -r requirements.txt
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 30 23:55:23 GMT 2024
    - 16.2K bytes
    - Viewed (0)
  10. docs/fr/docs/contributing.md

        </div>
    
    Il installera toutes les dépendances et votre FastAPI local dans votre environnement local.
    
    #### Utiliser votre FastAPI local
    
    Si vous créez un fichier Python qui importe et utilise FastAPI, et que vous l'exécutez avec le Python de votre environnement local, il utilisera votre code source FastAPI local.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Jul 27 18:51:07 GMT 2023
    - 16.3K bytes
    - Viewed (0)
Back to top