コンテンツにスキップ
per page, with , order by , clip by
Results of 1 - 10 of about 19 for because (0.002 sec.)
Lifespan Events 11474
Lifespan Events Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . You can define logic (code) that should be executed before the application starts up . This means t ... plication is shutting down . In this case, this code will be executed once , after having handled possibly many requests . Because this code is executed before the application starts taking requests, and right after it finishes handling requests, it cov ... e model per request, or one per user or something similar. Let's imagine that loading the model can take quite some time , because it has to read a lot of data from disk . So you don't want to do it for every request. You could load it at the top level ... also mean that it would load the model even if you are just running a simple automated test, then that test would be slow because it would have to wait for the model to load before being able to run an independent part of the code. That's what we'll so ...
https://man.mtool.work/fastapi/0.115/advanced/events/
Generate Clients 11474
Generate Clients Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . As FastAPI is based on the OpenAPI specification, you get automatic compatibility with many tools, ... will see that it has the schemas for the data to be sent in requests and received in responses: You can see those schemas because they were declared with the models in the app. That information is available in the app's OpenAPI schema , and then shown ... e Client Code To generate the client code you can use the command line application openapi-ts that would now be installed. Because it is installed in the local project, you probably wouldn't be able to call that command directly, but you would put it on ... createItemItemsPost don't look very clean: ItemsService . createItemItemsPost ({ name : "Plumbus" , price : 5 }) ...that's because the client generator uses the OpenAPI internal operation ID for each path operation . OpenAPI requires that each operation ...
https://man.mtool.work/fastapi/0.115/advanced/generate-clients/
Separate OpenAPI Schemas for Input and Output or Not 11474
Separate OpenAPI Schemas for Input and Output or Not Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . When using Pydantic v2 , the generated OpenAPI is a bit more e ... ravel through the multi-rick-verse" , ), Item ( name = "Plumbus" ), ] ...then the description field will not be required . Because it has a default value of None . Input Model in Docs You can confirm that in the docs, the description field doesn't have ... e = "Portal Gun" , description = "Device to travel through the multi-rick-verse" , ), Item ( name = "Plumbus" ), ] ...then because description has a default value, if you don't return anything for that field, it will still have that default value . Mode ... me cases it will have the default value of None . The way to describe this in OpenAPI, is to mark that field as required , because it will always be there. Because of that, the JSON Schema for a model can be different depending on if it's used for input ...
https://man.mtool.work/fastapi/0.115/how-to/separate-openapi-schemas/
Behind a Proxy 10689
Behind a Proxy Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . In some situations, you might need to use a proxy server like Traefik or Nginx with a configuration ... , the frontend (that runs in the browser) would try to reach /openapi.json and wouldn't be able to get the OpenAPI schema. Because we have a proxy with a path prefix of /api/v1 for our app, the frontend needs to fetch the OpenAPI schema at /api/v1/opena ... as we would expect, if you try the docs UI served by Uvicorn directly, without the path prefix in the URL, it won't work, because it expects to be accessed through the proxy. You can check it at http://127.0.0.1:8000/docs : But if we access the docs UI ... /v1/docs , it works correctly! ? You can check it at http://127.0.0.1:9999/api/v1/docs : Right as we wanted it. ✔️ This is because FastAPI uses this root_path to create the default server in OpenAPI with the URL provided by root_path . Additional server ...
https://man.mtool.work/fastapi/0.115/advanced/behind-a-proxy/
Sub Applications - Mounts 10415
Sub Applications - Mounts Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . If you need to have two independent FastAPI applications, with their own independent Open ... he correct sub-path prefix /subapi : If you try interacting with any of the two user interfaces, they will work correctly, because the browser will be able to talk to each specific app or sub-app. Technical Details: root_path When you mount a sub-applic ... the docs UI. And the sub-application could also have its own mounted sub-applications and everything would work correctly, because FastAPI handles all these root_path s automatically. You will learn more about the root_path and how to use it explicitly ...
https://man.mtool.work/fastapi/0.115/advanced/sub-applications/
Bigger Applications - Multiple Files 9357
Bigger Applications - Multiple Files Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . If you are building an application or a web API, it's rarely the case that you ... stom tags , responses , and dependencies We are not adding the prefix /items nor the tags=["items"] to each path operation because we added them to the APIRouter . But we can still add more tags that will be applied to a specific path operation , and al ... oid name collisions We are importing the submodule items directly, instead of importing just its variable router . This is because we also have another variable named router in the submodule users . If we had imported one after the other, like: from .ro ... tions that your organization shares between several projects. For this example it will be super simple. But let's say that because it is shared with other projects in the organization, we cannot modify it and add a prefix , dependencies , tags , etc. di ...
https://man.mtool.work/fastapi/0.115/tutorial/bigger-applications/
OpenAPI Callbacks 8298
OpenAPI Callbacks Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . You could create an API with a path operation that could trigger a request to an external API cre ... er that would be using your API). The process that happens when your API app calls the external API is named a "callback". Because the software that the external developer wrote sends a request to your API and then your API calls back , sending a reques ... "Invoice received" } There are 2 main differences from a normal path operation : It doesn't need to have any actual code, because your app will never call this code. It's only used to document the external API . So, the function could just have pass . ...
https://man.mtool.work/fastapi/0.115/advanced/openapi-callbacks/
OpenAPI Webhooks 8298
OpenAPI Webhooks Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . There are cases where you want to tell your API users that your app could call their app (sending ... name of the event), for example in @app.webhooks.post("new-subscription") , the webhook name is new-subscription . This is because it is expected that your users would define the actual URL path where they want to receive the webhook request in some oth ...
https://man.mtool.work/fastapi/0.115/advanced/openapi-webhooks/
Repository Management Tasks 8298
Repository Management Tasks These are the tasks that can be performed to manage the FastAPI repository by team members . Tip This section is useful only to a handful of people, team members with permissions to manage the repository. You can ... re. bug : Fixes Something that was supported didn't work, and this fixes it. There are many PRs that claim to be bug fixes because the user is doing something in an unexpected way that is not supported, but they considered it what should be supported by ... ve the awaiting-review label, and add the approved-1 label. This way, we can notice when there are new translations ready, because they have the approved-1 label. Merge Translation PRs For Spanish, as I'm a native speaker and it's a language close to me ...
https://man.mtool.work/fastapi/0.115/management-tasks/
Templates 8042
Templates Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . You can use any template engine you want with FastAPI . A common choice is Jinja2, the same one used by F ... a></h1> </body> </html> In this example, it would link to a CSS file at static/styles.css with: h1 { color : green ; } And because you are using StaticFiles , that CSS file would be served automatically by your FastAPI application at the URL /static/sty ...
https://man.mtool.work/fastapi/0.115/advanced/templates/
PREV 1 2 NEXT