Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 66 for or (0.16 sec)

  1. docs/en/docs/tutorial/dependencies/dependencies-with-yield.md

    ### Always `raise` in Dependencies with `yield` and `except`
    
    If you catch an exception in a dependency with `yield`, unless you are raising another `HTTPException` or similar, you should re-raise the original exception.
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Feb 24 23:06:37 GMT 2024
    - 14.1K bytes
    - Viewed (0)
  2. fastapi/openapi/utils.py

                            str(additional_status_code).upper()
                        ) or http.client.responses.get(int(additional_status_code))
                        description = (
                            process_response.get("description")
                            or openapi_response.get("description")
                            or status_text
                            or "Additional Response"
                        )
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 21.8K bytes
    - Viewed (0)
  3. fastapi/dependencies/utils.py

                # `tests/test_infer_param_optionality.py` for an example.
                field_info = params.Path(annotation=use_annotation)
            elif is_uploadfile_or_nonable_uploadfile_annotation(
                type_annotation
            ) or is_uploadfile_sequence_annotation(type_annotation):
                field_info = params.File(annotation=use_annotation, default=default_value)
    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)
  4. docs/en/docs/tutorial/sql-databases.md

        These Pydantic models define more or less a "schema" (a valid data shape).
    
        So this will help us avoiding confusion while using both.
    
    ### Create initial Pydantic *models* / schemas
    
    Create an `ItemBase` and `UserBase` Pydantic *models* (or let's say "schemas") to have common attributes while creating or reading data.
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 29.6K bytes
    - Viewed (0)
  5. scripts/docs.py

        # Contributors may wish to update or change these, e.g. to fix capitalization.
        language_names_path = Path(__file__).parent / "../docs/language_names.yml"
        local_language_names: Dict[str, str] = mkdocs.utils.yaml_load(
            language_names_path.read_text(encoding="utf-8")
        )
        for lang_path in get_lang_paths():
            if lang_path.name in {"en", "em"} or not lang_path.is_dir():
                continue
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Mon Jan 22 19:26:14 GMT 2024
    - 10.9K bytes
    - Viewed (1)
  6. docs/en/docs/advanced/settings.md

    # Settings and Environment Variables
    
    In many cases your application could need some external settings or configurations, for example secret keys, database credentials, credentials for email services, etc.
    
    Most of these settings are variable (can change), like database URLs. And many could be sensitive, like secrets.
    
    For this reason it's common to provide them in environment variables that are read by the application.
    
    ## Environment Variables
    
    !!! tip
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 15.7K bytes
    - Viewed (0)
  7. docs/en/docs/index.md

    You do that with standard modern Python types.
    
    You don't have to learn a new syntax, the methods or classes of a specific library, etc.
    
    Just standard **Python 3.8+**.
    
    For example, for an `int`:
    
    ```Python
    item_id: int
    ```
    
    or for a more complex `Item` model:
    
    ```Python
    item: Item
    ```
    
    ...and with that single declaration you get:
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 23:58:47 GMT 2024
    - 19.2K bytes
    - Viewed (0)
  8. tests/test_tutorial/test_security/test_tutorial005_an_py39.py

        assert response.json() == {"detail": "Incorrect username or password"}
    
    
    @needs_py39
    def test_login_incorrect_username(client: TestClient):
        response = client.post("/token", data={"username": "foo", "password": "secret"})
        assert response.status_code == 400, response.text
        assert response.json() == {"detail": "Incorrect username or password"}
    
    
    @needs_py39
    def test_no_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)
  9. tests/test_tutorial/test_security/test_tutorial005_py310.py

        assert response.json() == {"detail": "Incorrect username or password"}
    
    
    @needs_py310
    def test_login_incorrect_username(client: TestClient):
        response = client.post("/token", data={"username": "foo", "password": "secret"})
        assert response.status_code == 400, response.text
        assert response.json() == {"detail": "Incorrect username or password"}
    
    
    @needs_py310
    def test_no_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/en/docs/tutorial/dependencies/classes-as-dependencies.md

    So, if you have an object `something` (that might _not_ be a function) and you can "call" it (execute it) like:
    
    ```Python
    something()
    ```
    
    or
    
    ```Python
    something(some_argument, some_keyword_argument="foo")
    ```
    
    then it is a "callable".
    
    ## Classes as dependencies
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 11.4K bytes
    - Viewed (0)
Back to top