Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 113 for Oadd (0.15 sec)

  1. docs_src/background_tasks/tutorial002_py310.py

        if q:
            message = f"found query: {q}\n"
            background_tasks.add_task(write_log, message)
        return q
    
    
    @app.post("/send-notification/{email}")
    async def send_notification(
        email: str, background_tasks: BackgroundTasks, q: str = Depends(get_query)
    ):
        message = f"message to {email}\n"
        background_tasks.add_task(write_log, message)
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jan 07 14:11:31 GMT 2022
    - 643 bytes
    - Viewed (0)
  2. tests/test_tutorial/test_sql_databases/test_sql_databases_middleware_py39.py

    
    @needs_py39
    # TODO: pv2 add version with Pydantic v2
    @needs_pydanticv1
    def test_get_user(client):
        response = client.get("/users/1")
        assert response.status_code == 200, response.text
        data = response.json()
        assert "email" in data
        assert "id" in data
    
    
    @needs_py39
    # TODO: pv2 add version with Pydantic v2
    @needs_pydanticv1
    def test_nonexistent_user(client):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Mar 13 19:07:10 GMT 2024
    - 16.5K bytes
    - Viewed (0)
  3. tests/test_tutorial/test_sql_databases/test_sql_databases_py310.py

    
    @needs_py310
    # TODO: pv2 add version with Pydantic v2
    @needs_pydanticv1
    def test_get_user(client):
        response = client.get("/users/1")
        assert response.status_code == 200, response.text
        data = response.json()
        assert "email" in data
        assert "id" in data
    
    
    @needs_py310
    # TODO: pv2 add version with Pydantic v2
    @needs_pydanticv1
    def test_nonexistent_user(client):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Mar 13 19:07:10 GMT 2024
    - 16.5K bytes
    - Viewed (0)
  4. tests/test_tutorial/test_sql_databases/test_sql_databases_py39.py

    
    @needs_py39
    # TODO: pv2 add version with Pydantic v2
    @needs_pydanticv1
    def test_get_user(client):
        response = client.get("/users/1")
        assert response.status_code == 200, response.text
        data = response.json()
        assert "email" in data
        assert "id" in data
    
    
    @needs_py39
    # TODO: pv2 add version with Pydantic v2
    @needs_pydanticv1
    def test_nonexistent_user(client):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Mar 13 19:07:10 GMT 2024
    - 16.5K bytes
    - Viewed (0)
  5. docs/de/docs/advanced/middleware.md

    Dazu verwenden Sie `app.add_middleware()` (wie schon im Beispiel fΓΌr CORS gesehen).
    
    ```Python
    from fastapi import FastAPI
    from unicorn import UnicornMiddleware
    
    app = FastAPI()
    
    app.add_middleware(UnicornMiddleware, some_config="rainbow")
    ```
    
    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)
  6. docs/en/docs/tutorial/handling-errors.md

        They are handled automatically by **FastAPI** and converted to JSON.
    
    ## Add custom headers
    
    There are some situations in where it's useful to be able to add custom headers to the HTTP error. For example, for some types of security.
    
    You probably won't need to use it directly in your code.
    
    But in case you needed it for an advanced scenario, you can add custom headers:
    
    ```Python hl_lines="14"
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 9.1K bytes
    - Viewed (0)
  7. docs/em/docs/advanced/middleware.md

    ```
    
    βœ‹οΈ FastAPI (πŸ€™ πŸ’ƒ) 🚚 πŸ™… 🌌 ⚫️ πŸ‘ˆ βš’ πŸ’­ πŸ‘ˆ πŸ”— πŸ› οΈ 🍡 πŸ’½ ❌ & πŸ›ƒ ⚠ πŸ•β€πŸ¦Ί πŸ‘· β˜‘.
    
    πŸ‘ˆ, πŸ‘† βš™οΈ `app.add_middleware()` (πŸ–Ό ⚜).
    
    ```Python
    from fastapi import FastAPI
    from unicorn import UnicornMiddleware
    
    app = FastAPI()
    
    app.add_middleware(UnicornMiddleware, some_config="rainbow")
    ```
    
    `app.add_middleware()` πŸ“¨ πŸ› οΈ πŸŽ“ πŸ₯‡ ❌ & πŸ™† πŸŒ– ❌ πŸšΆβ€β™€οΈ πŸ› οΈ.
    
    ## πŸ› οΈ πŸ› οΈ
    
    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)
  8. 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)
  9. docs/en/docs/advanced/events.md

    ### `startup` event
    
    To add a function that should be run before the application starts, declare it with the event `"startup"`:
    
    ```Python hl_lines="8"
    {!../../../docs_src/events/tutorial001.py!}
    ```
    
    In this case, the `startup` event handler function will initialize the items "database" (just a `dict`) with some values.
    
    You can add more than one event handler function.
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 7.8K bytes
    - Viewed (0)
  10. .github/workflows/issue-manager.yml

              config: >
                {
                  "answered": {
                    "delay": 864000,
                    "message": "Assuming the original need was handled, this will be automatically closed now. But feel free to add more comments or create new issues or PRs."
                  },
                  "changes-requested": {
                    "delay": 2628000,
    Others
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Jan 30 18:46:56 GMT 2024
    - 1.1K bytes
    - Viewed (0)
Back to top