Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 96 for Sohn (0.16 sec)

  1. docs_src/python_types/tutorial011_py310.py

    from pydantic import BaseModel
    
    
    class User(BaseModel):
        id: int
        name: str = "John Doe"
        signup_ts: datetime | None = None
        friends: list[int] = []
    
    
    external_data = {
        "id": "123",
        "signup_ts": "2017-06-01 12:22",
        "friends": [1, "2", b"3"],
    }
    user = User(**external_data)
    print(user)
    # > User id=123 name='John Doe' signup_ts=datetime.datetime(2017, 6, 1, 12, 22) friends=[1, 2, 3]
    print(user.id)
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Sep 02 15:56:35 GMT 2023
    - 461 bytes
    - Viewed (0)
  2. tests/test_tutorial/test_security/test_tutorial006_an.py

    from docs_src.security.tutorial006_an import app
    
    client = TestClient(app)
    
    
    def test_security_http_basic():
        response = client.get("/users/me", auth=("john", "secret"))
        assert response.status_code == 200, response.text
        assert response.json() == {"username": "john", "password": "secret"}
    
    
    def test_security_http_basic_no_credentials():
        response = client.get("/users/me")
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 2.3K bytes
    - Viewed (0)
  3. tests/test_security_http_basic_realm_description.py

    
    client = TestClient(app)
    
    
    def test_security_http_basic():
        response = client.get("/users/me", auth=("john", "secret"))
        assert response.status_code == 200, response.text
        assert response.json() == {"username": "john", "password": "secret"}
    
    
    def test_security_http_basic_no_credentials():
        response = client.get("/users/me")
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 2.8K bytes
    - Viewed (0)
  4. docs_src/security/tutorial004_an_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,
        }
    }
    
    
    class Token(BaseModel):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Mar 26 16:56:53 GMT 2024
    - 4.1K bytes
    - Viewed (0)
  5. docs_src/security/tutorial005_an.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 Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Mar 26 16:56:53 GMT 2024
    - 5.3K bytes
    - Viewed (0)
  6. docs/en/docs/python-types.md

    ## Motivation
    
    Let's start with a simple example:
    
    ```Python
    {!../../../docs_src/python_types/tutorial001.py!}
    ```
    
    Calling this program outputs:
    
    ```
    John Doe
    ```
    
    The function does the following:
    
    * Takes a `first_name` and `last_name`.
    * Converts the first letter of each one to upper case with `title()`.
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 17K bytes
    - Viewed (0)
  7. docs/de/docs/features.md

    
    # Ein Pydantic-Modell
    class User(BaseModel):
        id: int
        name: str
        joined: date
    ```
    
    Das kann nun wie folgt verwendet werden:
    
    ```Python
    my_user: User = User(id=3, name="John Doe", joined="2018-07-19")
    
    second_user_data = {
        "id": 4,
        "name": "Mary",
        "joined": "2018-11-30",
    }
    
    my_second_user: User = User(**second_user_data)
    ```
    
    !!! info
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 30 19:43:43 GMT 2024
    - 10.8K bytes
    - Viewed (0)
  8. docs/zh/docs/tutorial/security/simple-oauth2.md

    ### 获取当前用户数据
    
    使用 `/users/me` 路径的 `GET` 操作。
    
    可以提取如下当前用户数据:
    
    ```JSON
    {
      "username": "johndoe",
      "email": "******@****.***",
      "full_name": "John Doe",
      "disabled": false,
      "hashed_password": "fakehashedsecret"
    }
    ```
    
    <img src="https://fastapi.tiangolo.com/img/tutorial/security/image06.png">
    
    点击小锁图标,注销后,再执行同样的操作,则会得到 HTTP 401 错误:
    
    ```JSON
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 8.8K bytes
    - Viewed (0)
  9. tests/test_tutorial/test_security/test_tutorial005_py39.py

            "/users/me", headers={"Authorization": f"Bearer {access_token}"}
        )
        assert response.status_code == 200, response.text
        assert response.json() == {
            "username": "johndoe",
            "full_name": "John Doe",
            "email": "******@****.***",
            "disabled": False,
        }
    
    
    @needs_py39
    def test_incorrect_token(client: TestClient):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Mar 13 19:07:10 GMT 2024
    - 16.3K bytes
    - Viewed (0)
  10. docs/em/docs/tutorial/security/simple-oauth2.md

    ### 🤚 👆 👍 👩‍💻 💽
    
    🔜 ⚙️ 🛠️ `GET` ⏮️ ➡ `/users/me`.
    
    👆 🔜 🤚 👆 👩‍💻 📊, 💖:
    
    ```JSON
    {
      "username": "johndoe",
      "email": "******@****.***",
      "full_name": "John Doe",
      "disabled": false,
      "hashed_password": "fakehashedsecret"
    }
    ```
    
    <img src="/img/tutorial/security/image06.png">
    
    🚥 👆 🖊 🔒 ℹ &amp; ⏏, &amp; ⤴️ 🔄 🎏 🛠️ 🔄, 👆 🔜 🤚 🇺🇸🔍 4️⃣0️⃣1️⃣ ❌:
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 8.9K bytes
    - Viewed (0)
Back to top