Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 13 for Stacks (0.18 sec)

  1. fastapi/dependencies/utils.py

                body=body,
                background_tasks=background_tasks,
                response=response,
                dependency_overrides_provider=dependency_overrides_provider,
                dependency_cache=dependency_cache,
                async_exit_stack=async_exit_stack,
            )
            (
                sub_values,
                sub_errors,
                background_tasks,
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Apr 02 02:52:56 GMT 2024
    - 29.5K bytes
    - Viewed (0)
  2. docs_src/background_tasks/tutorial002_py310.py

            log.write(message)
    
    
    def get_query(background_tasks: BackgroundTasks, q: str | None = None):
        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"
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jan 07 14:11:31 GMT 2022
    - 643 bytes
    - Viewed (0)
  3. tests/test_tutorial/test_background_tasks/test_tutorial001.py

    import os
    from pathlib import Path
    
    from fastapi.testclient import TestClient
    
    from docs_src.background_tasks.tutorial001 import app
    
    client = TestClient(app)
    
    
    def test():
        log = Path("log.txt")
        if log.is_file():
            os.remove(log)  # pragma: no cover
        response = client.post("/send-notification/******@****.***")
        assert response.status_code == 200, response.text
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Jul 09 18:06:12 GMT 2020
    - 578 bytes
    - Viewed (0)
  4. docs/sts/web-identity.py

        return text % make_authorization_url()
    
    
    def make_authorization_url():
        # Generate a random string for the state parameter
        # Save it for use later to prevent xsrf attacks
    
        state = str(uuid4())
        params = {"client_id": client_id,
                  "response_type": "code",
                  "state": state,
                  "redirect_uri": callback_uri,
                  "scope": "openid"}
    
    Python
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Wed Jul 28 01:37:51 GMT 2021
    - 2.9K bytes
    - Viewed (1)
  5. fastapi/applications.py

            )
    
            self.user_middleware: List[Middleware] = (
                [] if middleware is None else list(middleware)
            )
            self.middleware_stack: Union[ASGIApp, None] = None
            self.setup()
    
        def openapi(self) -> Dict[str, Any]:
            """
            Generate the OpenAPI schema of the application. This is called by FastAPI
            internally.
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Apr 02 02:48:51 GMT 2024
    - 172.2K bytes
    - Viewed (0)
  6. fastapi/background.py

    P = ParamSpec("P")
    
    
    class BackgroundTasks(StarletteBackgroundTasks):
        """
        A collection of background tasks that will be called after a response has been
        sent to the client.
    
        Read more about it in the
        [FastAPI docs for Background Tasks](https://fastapi.tiangolo.com/tutorial/background-tasks/).
    
        ## Example
    
        ```python
        from fastapi import BackgroundTasks, FastAPI
    
        app = FastAPI()
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Apr 02 02:48:51 GMT 2024
    - 1.7K bytes
    - Viewed (0)
  7. docs_src/background_tasks/tutorial002_an_py39.py

            log.write(message)
    
    
    def get_query(background_tasks: BackgroundTasks, q: Union[str, None] = None):
        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: Annotated[str, Depends(get_query)]
    ):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 696 bytes
    - Viewed (0)
  8. fastapi/routing.py

                async with AsyncExitStack() as async_exit_stack:
                    solved_result = await solve_dependencies(
                        request=request,
                        dependant=dependant,
                        body=body,
                        dependency_overrides_provider=dependency_overrides_provider,
                        async_exit_stack=async_exit_stack,
                    )
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Apr 02 02:48:51 GMT 2024
    - 170.1K bytes
    - Viewed (0)
  9. fastapi/dependencies/models.py

            self.websocket_param_name = websocket_param_name
            self.http_connection_param_name = http_connection_param_name
            self.response_param_name = response_param_name
            self.background_tasks_param_name = background_tasks_param_name
            self.security_scopes = security_scopes
            self.security_scopes_param_name = security_scopes_param_name
            self.name = name
            self.call = call
            self.use_cache = use_cache
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 2.4K bytes
    - Viewed (0)
  10. tests/test_tutorial/test_background_tasks/test_tutorial002.py

    import os
    from pathlib import Path
    
    from fastapi.testclient import TestClient
    
    from docs_src.background_tasks.tutorial002 import app
    
    client = TestClient(app)
    
    
    def test():
        log = Path("log.txt")
        if log.is_file():
            os.remove(log)  # pragma: no cover
        response = client.post("/send-notification/******@****.***?q=some-query")
        assert response.status_code == 200, response.text
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Jul 09 18:06:12 GMT 2020
    - 568 bytes
    - Viewed (0)
Back to top