Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 76 for hosts (0.24 sec)

  1. docs/de/docs/advanced/middleware.md

    ```
    
    ## `TrustedHostMiddleware`
    
    Erzwingt, dass alle eingehenden Requests einen korrekt gesetzten `Host`-Header haben, um sich vor HTTP-Host-Header-Angriffen zu schützen.
    
    ```Python hl_lines="2  6-8"
    {!../../../docs_src/advanced_middleware/tutorial002.py!}
    ```
    
    Die folgenden Argumente werden unterstützt:
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 30 20:18:15 GMT 2024
    - 4.4K bytes
    - Viewed (0)
  2. docs_src/advanced_middleware/tutorial002.py

    from fastapi import FastAPI
    from fastapi.middleware.trustedhost import TrustedHostMiddleware
    
    app = FastAPI()
    
    app.add_middleware(
        TrustedHostMiddleware, allowed_hosts=["example.com", "*.example.com"]
    )
    
    
    @app.get("/")
    async def main():
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Mar 26 19:09:53 GMT 2020
    - 279 bytes
    - Viewed (0)
  3. docs/en/docs/advanced/middleware.md

    ```
    
    ## `TrustedHostMiddleware`
    
    Enforces that all incoming requests have a correctly set `Host` header, in order to guard against HTTP Host Header attacks.
    
    ```Python hl_lines="2  6-8"
    {!../../../docs_src/advanced_middleware/tutorial002.py!}
    ```
    
    The following arguments are supported:
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Mar 10 18:27:10 GMT 2023
    - 4K bytes
    - Viewed (0)
  4. docs/em/docs/advanced/middleware.md

    ```
    
    ## `TrustedHostMiddleware`
    
    🛠️ 👈 🌐 📨 📨 ✔️ ☑ ⚒ `Host` 🎚, ✔ 💂‍♂ 🛡 🇺🇸🔍 🦠 🎚 👊.
    
    ```Python hl_lines="2  6-8"
    {!../../../docs_src/advanced_middleware/tutorial002.py!}
    ```
    
    📄 ❌ 🐕‍🦺:
    
    * `allowed_hosts` - 📇 🆔 📛 👈 🔜 ✔ 📛. 🃏 🆔 ✅ `*.example.com` 🐕‍🦺 🎀 📁. ✔ 🙆 📛 👯‍♂️ ⚙️ `allowed_hosts=["*"]` ⚖️ 🚫 🛠️.
    
    🚥 📨 📨 🔨 🚫 ✔ ☑ ⤴️ `400` 📨 🔜 📨.
    
    ## `GZipMiddleware`
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Apr 01 09:26:04 GMT 2023
    - 3.3K bytes
    - Viewed (0)
  5. docs/ru/docs/tutorial/debugging.md

    </div>
    
    то встроенная переменная `__name__`, автоматически создаваемая Python в вашем файле, будет иметь значение строкового типа `"__main__"`.
    
    Тогда выполнится условие и эта часть кода:
    
    ```Python
        uvicorn.run(app, host="0.0.0.0", port=8000)
    ```
    
    будет запущена.
    
    ---
    
    Но этого не произойдет, если вы импортируете этот модуль (файл).
    
    Таким образом, если у вас есть файл `importer.py` с таким импортом:
    
    ```Python
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 3.8K bytes
    - Viewed (0)
  6. docs/fr/docs/tutorial/debugging.md

    ```
    
    </div>
    
    alors la variable interne `__name__` de votre fichier, créée automatiquement par Python, aura pour valeur la chaîne de caractères `"__main__"`.
    
    Ainsi, la section :
    
    ```Python
        uvicorn.run(app, host="0.0.0.0", port=8000)
    ```
    
    va s'exécuter.
    
    ---
    
    Cela ne se produira pas si vous importez ce module (fichier).
    
    Par exemple, si vous avez un autre fichier `importer.py` qui contient :
    
    ```Python
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Mon Mar 06 16:26:49 GMT 2023
    - 2.9K bytes
    - Viewed (0)
  7. docs/em/docs/tutorial/debugging.md

    , 📄:
    
    ```Python
        uvicorn.run(app, host="0.0.0.0", port=8000)
    ```
    
    🔜 🏃.
    
    ---
    
    👉 🏆 🚫 🔨 🚥 👆 🗄 👈 🕹 (📁).
    
    , 🚥 👆 ✔️ ➕1️⃣ 📁 `importer.py` ⏮️:
    
    ```Python
    from myapp import app
    
    # Some more code
    ```
    
    👈 💼, 🏧 🔢 🔘 `myapp.py` 🔜 🚫 ✔️ 🔢 `__name__` ⏮️ 💲 `"__main__"`.
    
    , ⏸:
    
    ```Python
        uvicorn.run(app, host="0.0.0.0", port=8000)
    ```
    
    🔜 🚫 🛠️.
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Apr 01 09:26:04 GMT 2023
    - 2.1K bytes
    - Viewed (0)
  8. docs/pt/docs/deployment.md

    Nesse caso, seu `Dockerfile` poderia parecer assim:
    
    ```Dockerfile
    FROM python:3.7
    
    RUN pip install fastapi uvicorn
    
    EXPOSE 80
    
    COPY ./app /app
    
    CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "80"]
    ```
    
    ### Crie o código **FastAPI**
    
    * Crie um diretório `app` e entre nele.
    * Crie um arquivo `main.py` com:
    
    ```Python
    from fastapi import FastAPI
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Aug 18 16:16:54 GMT 2022
    - 16.8K bytes
    - Viewed (0)
  9. docs/en/docs/advanced/using-request-directly.md

    But there are specific cases where it's useful to get the `Request` object.
    
    ## Use the `Request` object directly
    
    Let's imagine you want to get the client's IP address/host inside of your *path operation function*.
    
    For that you need to access the request directly.
    
    ```Python hl_lines="1  7-8"
    {!../../../docs_src/using_request_directly/tutorial001.py!}
    ```
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Aug 29 14:02:58 GMT 2020
    - 2.3K bytes
    - Viewed (0)
  10. docs/ko/docs/deployment/docker.md

    RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
    
    COPY ./app /code/app
    
    CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "80"]
    
    # If running behind a proxy like Nginx or Traefik add --proxy-headers
    # CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "80", "--proxy-headers"]
    ```
    
    </details>
    
    ## 컨테이너란
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 42.6K bytes
    - Viewed (0)
Back to top