Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 96 for Kohn (0.18 sec)

  1. tests/test_dependency_security_overrides.py

        response = client.get("/user")
        assert response.json() == {
            "user": "john",
            "scopes": ["foo", "bar"],
            "data": [1, 2, 3],
        }
    
    
    def test_override_data():
        app.dependency_overrides[get_data] = get_data_override
        response = client.get("/user")
        assert response.json() == {
            "user": "john",
            "scopes": ["foo", "bar"],
            "data": [3, 4, 5],
        }
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sun Jun 14 15:54:46 GMT 2020
    - 1.4K bytes
    - Viewed (0)
  2. docs_src/security/tutorial002_an_py310.py

        email: str | None = None
        full_name: str | None = None
        disabled: bool | None = None
    
    
    def fake_decode_token(token):
        return User(
            username=token + "fakedecoded", email="john@example.com", full_name="John Doe"
        )
    
    
    async def get_current_user(token: Annotated[str, Depends(oauth2_scheme)]):
        user = fake_decode_token(token)
        return user
    
    
    @app.get("/users/me")
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 761 bytes
    - Viewed (0)
  3. docs_src/security/tutorial002_an.py

        full_name: Union[str, None] = None
        disabled: Union[bool, None] = None
    
    
    def fake_decode_token(token):
        return User(
            username=token + "fakedecoded", email="john@example.com", full_name="John Doe"
        )
    
    
    async def get_current_user(token: Annotated[str, Depends(oauth2_scheme)]):
        user = fake_decode_token(token)
        return user
    
    
    @app.get("/users/me")
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 815 bytes
    - Viewed (0)
  4. docs/ru/docs/tutorial/extra-models.md

    У Pydantic-моделей есть метод `.dict()`, который возвращает `dict` с данными модели.
    
    Поэтому, если мы создадим Pydantic-объект `user_in` таким способом:
    
    ```Python
    user_in = UserIn(username="john", password="secret", email="john******@****.***")
    ```
    
    и затем вызовем:
    
    ```Python
    user_dict = user_in.dict()
    ```
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 11.6K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_custom_docs_ui/test_tutorial002.py

        assert "/static/redoc.standalone.js" in response.text
    
    
    def test_api(client: TestClient):
        response = client.get("/users/john")
        assert response.status_code == 200, response.text
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Aug 19 19:54:04 GMT 2023
    - 1.2K bytes
    - Viewed (0)
  6. docs/en/docs/tutorial/extra-models.md

    Pydantic models have a `.dict()` method that returns a `dict` with the model's data.
    
    So, if we create a Pydantic object `user_in` like:
    
    ```Python
    user_in = UserIn(username="john", password="secret", email="john******@****.***")
    ```
    
    and then we call:
    
    ```Python
    user_dict = user_in.dict()
    ```
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 7.7K bytes
    - Viewed (1)
  7. tests/test_tutorial/test_custom_docs_ui/test_tutorial001.py

        assert "https://unpkg.com/redoc@next/bundles/redoc.standalone.js" in response.text
    
    
    def test_api(client: TestClient):
        response = client.get("/users/john")
        assert response.status_code == 200, response.text
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Mon Oct 30 09:58:58 GMT 2023
    - 1.3K bytes
    - Viewed (0)
  8. docs_src/python_types/tutorial002.py

    def get_full_name(first_name: str, last_name: str):
        full_name = first_name.title() + " " + last_name.title()
        return full_name
    
    
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Mar 26 19:09:53 GMT 2020
    - 172 bytes
    - Viewed (0)
  9. docs_src/security/tutorial003.py

    from fastapi.security import OAuth2PasswordBearer, OAuth2PasswordRequestForm
    from pydantic import BaseModel
    
    fake_users_db = {
        "johndoe": {
            "username": "johndoe",
            "full_name": "John Doe",
            "email": "******@****.***",
            "hashed_password": "fakehashedsecret",
            "disabled": False,
        },
        "alice": {
            "username": "alice",
            "full_name": "Alice Wonderson",
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat May 14 11:59:59 GMT 2022
    - 2.4K bytes
    - Viewed (0)
  10. docs_src/security/tutorial005_py310.py

    SECRET_KEY = "09d25e094faa6ca2556c818166b7a9563b93f7099f6f0f4caa6cf63b88e8d3e7"
    ALGORITHM = "HS256"
    ACCESS_TOKEN_EXPIRE_MINUTES = 30
    
    
    fake_users_db = {
        "johndoe": {
            "username": "johndoe",
            "full_name": "John Doe",
            "email": "******@****.***",
            "hashed_password": "$2b$12$EixZaYVK1fsbw1ZfbX3OXePaWxn96p36WQoeG6Lruj3vjPGga31lW",
            "disabled": False,
        },
        "alice": {
            "username": "alice",
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Mar 26 16:56:53 GMT 2024
    - 5.1K bytes
    - Viewed (0)
Back to top