- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 43 for Case (0.2 sec)
-
docs/en/docs/advanced/events.md
## Use Case Let's start with an example **use case** and then see how to solve it with this. Let's imagine that you have some **machine learning models** that you want to use to handle requests. 🤖
Plain Text - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Thu Apr 18 19:53:19 GMT 2024 - 7.8K bytes - Viewed (0) -
docs/en/docs/advanced/settings.md
!!! tip If you want something quick to copy and paste, don't use this example, use the last one below. Then, when you create an instance of that `Settings` class (in this case, in the `settings` object), Pydantic will read the environment variables in a case-insensitive way, so, an upper-case variable `APP_NAME` will still be read for the attribute `app_name`.
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) -
docs/en/docs/tutorial/dependencies/classes-as-dependencies.md
For example: ```Python class Cat: def __init__(self, name: str): self.name = name fluffy = Cat(name="Mr Fluffy") ``` In this case, `fluffy` is an instance of the class `Cat`. And to create `fluffy`, you are "calling" `Cat`. So, a Python class is also a **callable**. Then, in **FastAPI**, you could use a Python class as a dependency.
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) -
docs/en/docs/tutorial/sql-databases.md
To create the `SessionLocal` class, use the function `sessionmaker`: ```Python hl_lines="11" {!../../../docs_src/sql_databases/sql_app/database.py!} ``` ### Create a `Base` class Now we will use the function `declarative_base()` that returns a class. Later we will inherit from this class to create each of the database models or classes (the ORM models): ```Python hl_lines="13"
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) -
docs/en/docs/advanced/custom-response.md
The contents that you return from your *path operation function* will be put inside of that `Response`. And if that `Response` has a JSON media type (`application/json`), like is the case with the `JSONResponse` and `UJSONResponse`, the data you return will be automatically converted (and filtered) with any Pydantic `response_model` that you declared in the *path operation decorator*. !!! note
Plain Text - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Thu Apr 18 19:53:19 GMT 2024 - 11.7K bytes - Viewed (0) -
docs/en/docs/tutorial/security/simple-oauth2.md
Any HTTP (error) status code 401 "UNAUTHORIZED" is supposed to also return a `WWW-Authenticate` header. In the case of bearer tokens (our case), the value of that header should be `Bearer`. You can actually skip that extra header and it would still work. But it's provided here to be compliant with the specifications.
Plain Text - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Thu Apr 18 19:53:19 GMT 2024 - 12.5K bytes - Viewed (0) -
docs/en/docs/index.md
* As the `q` parameter is declared with `= None`, it is optional. * Without the `None` it would be required (as is the body in the case with `PUT`). * For `PUT` requests to `/items/{item_id}`, Read the body as JSON: * Check that it has a required attribute `name` that should be a `str`.
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) -
docs/en/docs/deployment/server-workers.md
``` * So, the colon in `main:app` would be equivalent to the Python `import` part in `from main import app`. * `--workers`: The number of worker processes to use, each will run a Uvicorn worker, in this case, 4 workers. * `--worker-class`: The Gunicorn-compatible worker class to use in the worker processes. * Here we pass the class that Gunicorn can import and use with: ```Python
Plain Text - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Thu Apr 18 19:53:19 GMT 2024 - 9.1K bytes - Viewed (0) -
docs/en/docs/deployment/docker.md
In this case, if you had **multiple containers**, by default, when Prometheus came to **read the metrics**, it would get the ones for **a single container each time** (for the container that handled that particular request), instead of getting the **accumulated metrics** for all the replicated containers.
Plain Text - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Thu Apr 18 19:53:19 GMT 2024 - 34.3K bytes - Viewed (0) -
docs/en/docs/tutorial/extra-models.md
{!> ../../../docs_src/extra_models/tutorial005.py!} ``` ## Recap Use multiple Pydantic models and inherit freely for each case.
Plain Text - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Thu Apr 18 19:53:19 GMT 2024 - 7.7K bytes - Viewed (1)