- Sort Score
- Result 10 results
- Languages All
Results 61 - 70 of 83 for now (0.2 sec)
-
docs_src/security/tutorial005_py39.py
return user def create_access_token(data: dict, expires_delta: Union[timedelta, None] = None): to_encode = data.copy() if expires_delta: expire = datetime.now(timezone.utc) + expires_delta else: expire = datetime.now(timezone.utc) + timedelta(minutes=15) to_encode.update({"exp": expire}) encoded_jwt = jwt.encode(to_encode, SECRET_KEY, algorithm=ALGORITHM) return encoded_jwt
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) -
docs_src/security/tutorial005.py
return user def create_access_token(data: dict, expires_delta: Union[timedelta, None] = None): to_encode = data.copy() if expires_delta: expire = datetime.now(timezone.utc) + expires_delta else: expire = datetime.now(timezone.utc) + timedelta(minutes=15) to_encode.update({"exp": expire}) encoded_jwt = jwt.encode(to_encode, SECRET_KEY, algorithm=ALGORITHM) return encoded_jwt
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) -
docs/en/docs/advanced/response-directly.md
The example above shows all the parts you need, but it's not very useful yet, as you could have just returned the `item` directly, and **FastAPI** would put it in a `JSONResponse` for you, converting it to a `dict`, etc. All that by default. Now, let's see how you could use that to return a custom response. Let's say that you want to return an <a href="https://en.wikipedia.org/wiki/XML" class="external-link" target="_blank">XML</a> response.
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sat Aug 29 14:02:58 GMT 2020 - 3K bytes - Viewed (0) -
docs/en/docs/tutorial/dependencies/dependencies-with-yield.md
=== "Python 3.8+ non-Annotated" !!! tip Prefer to use the `Annotated` version if possible. ```Python hl_lines="15" {!> ../../../docs_src/dependencies/tutorial008d.py!} ``` Now the client will get the same *HTTP 500 Internal Server Error* response, but the server will have our custom `InternalError` in the logs. 😎 ## Execution of dependencies with `yield`
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sat Feb 24 23:06:37 GMT 2024 - 14.1K bytes - Viewed (0) -
docs/en/docs/async.md
Then you go to the counter 🔀, to the initial task that is now finished ⏯, pick the burgers, say thanks and take them to the table. That finishes that step / task of interaction with the counter ⏹. That in turn, creates a new task, of "eating burgers" 🔀 ⏯, but the previous one of "getting burgers" is finished ⏹. ### Parallel Burgers Now let's imagine these aren't "Concurrent Burgers", but "Parallel Burgers".
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Apr 18 19:53:19 GMT 2024 - 23K bytes - Viewed (0) -
docs/en/docs/help-fastapi.md
### Ask to close If they reply, there's a high chance you would have solved their problem, congrats, **you're a hero**! 🦸 * Now, if that solved their problem, you can ask them to: * In GitHub Discussions: mark the comment as the **answer**. * In GitHub Issues: **close** the issue. ## Watch the GitHub repository
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Apr 18 19:53:19 GMT 2024 - 13.7K bytes - Viewed (0) -
docs/en/docs/tutorial/query-params.md
=== "Python 3.8+" ```Python hl_lines="8 10" {!> ../../../docs_src/query_params/tutorial004.py!} ``` ## Required query parameters When you declare a default value for non-path parameters (for now, we have only seen query parameters), then it is not required. If you don't want to add a specific value but just make it optional, set the default as `None`.
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri Oct 20 09:08:42 GMT 2023 - 5.1K bytes - Viewed (0) -
docs/en/data/sponsors.yml
gold: - url: https://cryptapi.io/ title: "CryptAPI: Your easy to use, secure and privacy oriented payment gateway." img: https://fastapi.tiangolo.com/img/sponsors/cryptapi.svg - url: https://platform.sh/try-it-now/?utm_source=fastapi-signup&utm_medium=banner&utm_campaign=FastAPI-signup-June-2023 title: "Build, run and scale your apps on a modern, reliable, and secure PaaS." img: https://fastapi.tiangolo.com/img/sponsors/platform-sh.png
Others - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Mon Mar 25 23:10:11 GMT 2024 - 3.3K bytes - Viewed (0) -
docs/en/docs/tutorial/dependencies/classes-as-dependencies.md
And we know that editors can't provide a lot of support (like completion) for `dict`s, because they can't know their keys and value types. We can do better... ## What makes a dependency Up to now you have seen dependencies declared as functions. But that's not the only way to declare dependencies (although it would probably be the more common). The key factor is that a dependency should be a "callable".
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Apr 18 19:53:19 GMT 2024 - 11.4K bytes - Viewed (0) -
docs/en/docs/tutorial/extra-models.md
```Python user_in = UserIn(username="john", password="secret", email="******@****.***") ``` and then we call: ```Python user_dict = user_in.dict() ``` we now have a `dict` with the data in the variable `user_dict` (it's a `dict` instead of a Pydantic model object). And if we call: ```Python print(user_dict) ``` we would get a Python `dict` with: ```Python
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)