Search Options

Results per page
Sort
Preferred Languages
Advance

Results 31 - 40 of 246 for tourer (0.23 sec)

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

    We are importing the submodule `items` directly, instead of importing just its variable `router`.
    
    This is because we also have another variable named `router` in the submodule `users`.
    
    If we had imported one after the other, like:
    
    ```Python
    from .routers.items import router
    from .routers.users import router
    ```
    
    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. tests/test_custom_route_class.py

        x_type = "C"
    
    
    router_a = APIRouter(route_class=APIRouteA)
    router_b = APIRouter(route_class=APIRouteB)
    router_c = APIRouter(route_class=APIRouteC)
    
    
    @router_a.get("/")
    def get_a():
        return {"msg": "A"}
    
    
    @router_b.get("/")
    def get_b():
        return {"msg": "B"}
    
    
    @router_c.get("/")
    def get_c():
        return {"msg": "C"}
    
    
    router_b.include_router(router=router_c, prefix="/c")
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 3.1K bytes
    - Viewed (0)
  3. tests/test_ws_dependencies.py

    
    def create_dependency(name: str):
        def fun(deps: DepList):
            deps.append(name)
    
        return Depends(fun)
    
    
    router = APIRouter(dependencies=[create_dependency("router")])
    prefix_router = APIRouter(dependencies=[create_dependency("prefix_router")])
    app = FastAPI(dependencies=[create_dependency("app")])
    
    
    @app.websocket("/", dependencies=[create_dependency("index")])
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sun Jun 11 20:35:39 GMT 2023
    - 2.1K bytes
    - Viewed (0)
  4. docs_src/bigger_applications/app_an_py39/main.py

    from .internal import admin
    from .routers import items, users
    
    app = FastAPI(dependencies=[Depends(get_query_token)])
    
    
    app.include_router(users.router)
    app.include_router(items.router)
    app.include_router(
        admin.router,
        prefix="/admin",
        tags=["admin"],
        dependencies=[Depends(get_token_header)],
        responses={418: {"description": "I'm a teapot"}},
    )
    
    
    @app.get("/")
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 552 bytes
    - Viewed (0)
  5. tests/test_additional_response_extra.py

    from fastapi import APIRouter, FastAPI
    from fastapi.testclient import TestClient
    
    router = APIRouter()
    
    sub_router = APIRouter()
    
    app = FastAPI()
    
    
    @sub_router.get("/")
    def read_item():
        return {"id": "foo"}
    
    
    router.include_router(sub_router, prefix="/items")
    
    app.include_router(router)
    
    client = TestClient(app)
    
    
    def test_path_operation():
        response = client.get("/items/")
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 1.2K bytes
    - Viewed (0)
  6. docs_src/bigger_applications/app/internal/admin.py

    from fastapi import APIRouter
    
    router = APIRouter()
    
    
    @router.post("/")
    async def update_admin():
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sun Nov 29 17:32:18 GMT 2020
    - 147 bytes
    - Viewed (0)
  7. tests/test_sub_callbacks.py

        ok: bool
    
    
    invoices_callback_router = APIRouter()
    
    
    @invoices_callback_router.post(
        "{$callback_url}/invoices/{$request.body.id}", response_model=InvoiceEventReceived
    )
    def invoice_notification(body: InvoiceEvent):
        pass  # pragma: nocover
    
    
    class Event(BaseModel):
        name: str
        total: float
    
    
    events_callback_router = APIRouter()
    
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 13.8K bytes
    - Viewed (0)
  8. cni/pkg/nodeagent/healthServer_test.go

    	"istio.io/istio/cni/pkg/constants"
    	"istio.io/istio/pkg/test/util/assert"
    )
    
    func TestServer(t *testing.T) {
    	router := http.NewServeMux()
    	installReady, watchReady := initRouter(router)
    
    	assert.Equal(t, installReady.Load(), false)
    	assert.Equal(t, watchReady.Load(), false)
    
    	server := httptest.NewServer(router)
    	defer server.Close()
    
    	makeReq(t, server.URL, constants.LivenessEndpoint, http.StatusOK)
    Go
    - Registered: Wed May 01 22:53:12 GMT 2024
    - Last Modified: Fri Jan 26 20:34:28 GMT 2024
    - 2K bytes
    - Viewed (0)
  9. tests/test_modules_same_name_body/app/b.py

    from fastapi import APIRouter, Body
    
    router = APIRouter()
    
    
    @router.post("/compute/")
    def compute(a: int = Body(), b: str = Body()):
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri May 13 23:38:22 GMT 2022
    - 161 bytes
    - Viewed (0)
  10. docs_src/bigger_applications/app/main.py

    from .internal import admin
    from .routers import items, users
    
    app = FastAPI(dependencies=[Depends(get_query_token)])
    
    
    app.include_router(users.router)
    app.include_router(items.router)
    app.include_router(
        admin.router,
        prefix="/admin",
        tags=["admin"],
        dependencies=[Depends(get_token_header)],
        responses={418: {"description": "I'm a teapot"}},
    )
    
    
    @app.get("/")
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sun Nov 29 17:32:18 GMT 2020
    - 552 bytes
    - Viewed (0)
Back to top