Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 1,398 for import (0.19 sec)

  1. fastapi/security/__init__.py

    from .api_key import APIKeyCookie as APIKeyCookie
    from .api_key import APIKeyHeader as APIKeyHeader
    from .api_key import APIKeyQuery as APIKeyQuery
    from .http import HTTPAuthorizationCredentials as HTTPAuthorizationCredentials
    from .http import HTTPBasic as HTTPBasic
    from .http import HTTPBasicCredentials as HTTPBasicCredentials
    from .http import HTTPBearer as HTTPBearer
    from .http import HTTPDigest as HTTPDigest
    from .oauth2 import OAuth2 as OAuth2
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sun Dec 20 18:50:00 GMT 2020
    - 881 bytes
    - Viewed (0)
  2. fastapi/security/http.py

    import binascii
    from base64 import b64decode
    from typing import Optional
    
    from fastapi.exceptions import HTTPException
    from fastapi.openapi.models import HTTPBase as HTTPBaseModel
    from fastapi.openapi.models import HTTPBearer as HTTPBearerModel
    from fastapi.security.base import SecurityBase
    from fastapi.security.utils import get_authorization_scheme_param
    from pydantic import BaseModel
    from starlette.requests import Request
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Apr 19 15:29:38 GMT 2024
    - 13.2K bytes
    - Viewed (0)
  3. tests/test_tutorial/test_testing_dependencies/test_tutorial001_py310.py

    from ...utils import needs_py310
    
    
    @needs_py310
    def test_override_in_items_run():
        from docs_src.dependency_testing.tutorial001_py310 import test_override_in_items
    
        test_override_in_items()
    
    
    @needs_py310
    def test_override_in_items_with_q_run():
        from docs_src.dependency_testing.tutorial001_py310 import (
            test_override_in_items_with_q,
        )
    
        test_override_in_items_with_q()
    
    
    @needs_py310
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 2K bytes
    - Viewed (0)
  4. docs_src/handling_errors/tutorial005.py

    from fastapi import FastAPI, Request, status
    from fastapi.encoders import jsonable_encoder
    from fastapi.exceptions import RequestValidationError
    from fastapi.responses import JSONResponse
    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    @app.exception_handler(RequestValidationError)
    async def validation_exception_handler(request: Request, exc: RequestValidationError):
        return JSONResponse(
            status_code=status.HTTP_422_UNPROCESSABLE_ENTITY,
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Mar 26 19:09:53 GMT 2020
    - 667 bytes
    - Viewed (0)
  5. tests/test_compat.py

    from typing import List, Union
    
    from fastapi import FastAPI, UploadFile
    from fastapi._compat import (
        ModelField,
        Undefined,
        _get_model_config,
        is_bytes_sequence_annotation,
        is_uploadfile_sequence_annotation,
    )
    from fastapi.testclient import TestClient
    from pydantic import BaseConfig, BaseModel, ConfigDict
    from pydantic.fields import FieldInfo
    
    from .utils import needs_pydanticv1, needs_pydanticv2
    
    
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Sep 28 04:14:40 GMT 2023
    - 2.8K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_background_tasks/test_tutorial002_an_py310.py

    import os
    from pathlib import Path
    
    from fastapi.testclient import TestClient
    
    from ...utils import needs_py310
    
    
    @needs_py310
    def test():
        from docs_src.background_tasks.tutorial002_an_py310 import app
    
        client = TestClient(app)
        log = Path("log.txt")
        if log.is_file():
            os.remove(log)  # pragma: no cover
        response = client.post("/send-notification/******@****.***?q=some-query")
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 631 bytes
    - Viewed (0)
  7. tests/test_validate_response.py

    from typing import List, Optional, Union
    
    import pytest
    from fastapi import FastAPI
    from fastapi.exceptions import ResponseValidationError
    from fastapi.testclient import TestClient
    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class Item(BaseModel):
        name: str
        price: Optional[float] = None
        owner_ids: Optional[List[int]] = None
    
    
    @app.get("/items/invalid", response_model=Item)
    def get_invalid():
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 2K bytes
    - Viewed (0)
  8. tests/test_tutorial/test_dependencies/test_tutorial008d_an.py

    import pytest
    from fastapi.testclient import TestClient
    
    
    @pytest.fixture(name="client")
    def get_client():
        from docs_src.dependencies.tutorial008d_an import app
    
        client = TestClient(app)
        return client
    
    
    def test_get_no_item(client: TestClient):
        response = client.get("/items/foo")
        assert response.status_code == 404, response.text
        assert response.json() == {"detail": "Item not found, there's only a plumbus here"}
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Feb 24 23:06:37 GMT 2024
    - 1.2K bytes
    - Viewed (0)
  9. docs_src/security/tutorial004_an.py

    from datetime import datetime, timedelta, timezone
    from typing import Union
    
    from fastapi import Depends, FastAPI, HTTPException, status
    from fastapi.security import OAuth2PasswordBearer, OAuth2PasswordRequestForm
    from jose import JWTError, jwt
    from passlib.context import CryptContext
    from pydantic import BaseModel
    from typing_extensions import Annotated
    
    # to get a string like this run:
    # openssl rand -hex 32
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Mar 26 16:56:53 GMT 2024
    - 4.1K bytes
    - Viewed (0)
  10. fastapi/utils.py

    import re
    import warnings
    from dataclasses import is_dataclass
    from typing import (
        TYPE_CHECKING,
        Any,
        Dict,
        MutableMapping,
        Optional,
        Set,
        Type,
        Union,
        cast,
    )
    from weakref import WeakKeyDictionary
    
    import fastapi
    from fastapi._compat import (
        PYDANTIC_V2,
        BaseConfig,
        ModelField,
        PydanticSchemaGenerationError,
        Undefined,
        UndefinedType,
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 7.8K bytes
    - Viewed (0)
Back to top