Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 12 for getEnv (0.18 sec)

  1. pdm_build.py

    import os
    from typing import Any, Dict, List
    
    from pdm.backend.hooks import Context
    
    TIANGOLO_BUILD_PACKAGE = os.getenv("TIANGOLO_BUILD_PACKAGE", "fastapi")
    
    
    def pdm_build_initialize(context: Context) -> None:
        metadata = context.config.metadata
        # Get custom config for the current package, from the env var
        config: Dict[str, Any] = context.config.data["tool"]["tiangolo"][
            "_internal-slim-build"
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Apr 30 06:38:13 GMT 2024
    - 1.7K bytes
    - Viewed (0)
  2. docs/em/docs/advanced/settings.md

    🖼 👆 💪 ✔️ 📁 `main.py` ⏮️:
    
    ```Python hl_lines="3"
    import os
    
    name = os.getenv("MY_NAME", "World")
    print(f"Hello {name} from Python")
    ```
    
    !!! tip
        🥈 ❌ <a href="https://docs.python.org/3.8/library/os.html#os.getenv" class="external-link" target="_blank">`os.getenv()`</a> 🔢 💲 📨.
    
        🚥 🚫 🚚, ⚫️ `None` 🔢, 📥 👥 🚚 `"World"` 🔢 💲 ⚙️.
    
    ⤴️ 👆 💪 🤙 👈 🐍 📋:
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 11.4K bytes
    - Viewed (0)
  3. docs/de/docs/advanced/settings.md

    Sie könnten zum Beispiel eine Datei `main.py` haben mit:
    
    ```Python hl_lines="3"
    import os
    
    name = os.getenv("MY_NAME", "World")
    print(f"Hello {name} from Python")
    ```
    
    !!! tip "Tipp"
        Das zweite Argument für <a href="https://docs.python.org/3.8/library/os.html#os.getenv" class="external-link" target="_blank">`os.getenv()`</a> ist der zurückzugebende Defaultwert.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 30 20:17:14 GMT 2024
    - 17.8K bytes
    - Viewed (0)
  4. docs/en/docs/advanced/settings.md

    For example you could have a file `main.py` with:
    
    ```Python hl_lines="3"
    import os
    
    name = os.getenv("MY_NAME", "World")
    print(f"Hello {name} from Python")
    ```
    
    !!! tip
        The second argument to <a href="https://docs.python.org/3.8/library/os.html#os.getenv" class="external-link" target="_blank">`os.getenv()`</a> is the default value to return.
    
    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)
  5. docs/zh/docs/advanced/settings.md

    例如,您可以有一个名为 `main.py` 的文件,其中包含以下内容:
    
    ```Python hl_lines="3"
    import os
    
    name = os.getenv("MY_NAME", "World")
    print(f"Hello {name} from Python")
    ```
    
    !!! tip
        <a href="https://docs.python.org/3.8/library/os.html#os.getenv" class="external-link" target="_blank">`os.getenv()`</a> 的第二个参数是要返回的默认值。
    
        如果没有提供默认值,默认为 `None`,此处我们提供了 `"World"` 作为要使用的默认值。
    
    然后,您可以调用该 Python 程序:
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 13.9K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_settings/test_app02.py

    from pytest import MonkeyPatch
    
    from ...utils import needs_pydanticv2
    
    
    @needs_pydanticv2
    def test_settings(monkeypatch: MonkeyPatch):
        from docs_src.settings.app02 import main
    
        monkeypatch.setenv("ADMIN_EMAIL", "******@****.***")
        settings = main.get_settings()
        assert settings.app_name == "Awesome API"
        assert settings.items_per_user == 50
    
    
    @needs_pydanticv2
    def test_override_settings():
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 488 bytes
    - Viewed (0)
  7. tests/test_tutorial/test_settings/test_tutorial001.py

    from fastapi.testclient import TestClient
    from pytest import MonkeyPatch
    
    from ...utils import needs_pydanticv2
    
    
    @needs_pydanticv2
    def test_settings(monkeypatch: MonkeyPatch):
        monkeypatch.setenv("ADMIN_EMAIL", "******@****.***")
        from docs_src.settings.tutorial001 import app
    
        client = TestClient(app)
        response = client.get("/info")
        assert response.status_code == 200, response.text
        assert response.json() == {
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 552 bytes
    - Viewed (0)
  8. docs/de/docs/deployment/manually.md

        ---> 100%
        ```
    
        </div>
    
        ... oder jeden anderen ASGI-Server.
    
    ## Das Serverprogramm ausführen
    
    Anschließend können Sie Ihre Anwendung auf die gleiche Weise ausführen, wie Sie es in den Tutorials getan haben, jedoch ohne die Option `--reload`, z. B.:
    
    === "Uvicorn"
    
        <div class="termy">
    
        ```console
        $ uvicorn main:app --host 0.0.0.0 --port 80
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 30 20:16:35 GMT 2024
    - 5.4K bytes
    - Viewed (0)
  9. docs/de/docs/contributing.md

    </div>
    
    wird das, da Uvicorn standardmäßig den Port `8000` verwendet, mit der Dokumentation auf dem Port `8008` nicht in Konflikt geraten.
    
    ### Übersetzungen
    
    Hilfe bei Übersetzungen wird SEHR geschätzt! Und es kann nicht getan werden, ohne die Hilfe der Gemeinschaft. 🌎 🚀
    
    Hier sind die Schritte, die Ihnen bei Übersetzungen helfen.
    
    #### Tipps und Richtlinien
    
    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. tests/test_tutorial/test_settings/test_tutorial001_pv1.py

    from fastapi.testclient import TestClient
    from pytest import MonkeyPatch
    
    from ...utils import needs_pydanticv1
    
    
    @needs_pydanticv1
    def test_settings(monkeypatch: MonkeyPatch):
        monkeypatch.setenv("ADMIN_EMAIL", "******@****.***")
        from docs_src.settings.tutorial001_pv1 import app
    
        client = TestClient(app)
        response = client.get("/info")
        assert response.status_code == 200, response.text
        assert response.json() == {
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 556 bytes
    - Viewed (0)
Back to top