コンテンツにスキップ
per page, with , order by , clip by
Results of 1 - 10 of about 15 for above (0.004 sec.)
Lifespan Events 11825
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 ... c with : async with lifespan ( app ): await do_stuff () When you create a context manager or an async context manager like above, what it does is that, before entering the with block, it will execute the code before the yield , and after exiting the w ... ith block, it will execute the code after the yield . In our code example above, we don't use it directly, but we pass it to FastAPI for it to use it. The lifespan parameter of the FastAPI app takes an ... ing The recommended way to handle the startup and shutdown is using the lifespan parameter of the FastAPI app as described above. If you provide a lifespan parameter, startup and shutdown event handlers will no longer be called. It's all lifespan or a ...
https://man.mtool.work/fastapi/0.115/advanced/events/
OpenAPI Webhooks 10937
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 ... ests, they might even be able to autogenerate some of their own API code. Info Webhooks are available in OpenAPI 3.1.0 and above, supported by FastAPI 0.99.0 and above. An app with webhooks When you create a FastAPI application, there is a webhooks at ...
https://man.mtool.work/fastapi/0.115/advanced/openapi-webhooks/
Extending OpenAPI 10937
Extending OpenAPI Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . There are some cases where you might need to modify the generated OpenAPI schema. In this section ... registered path operations . They are taken from app.routes . Info The parameter summary is available in OpenAPI 3.1.0 and above, supported by FastAPI 0.99.0 and above. Overriding the defaults Using the information above, you can use the same utility ...
https://man.mtool.work/fastapi/0.115/how-to/extending-openapi/
Development - Contributing 10049
Development - Contributing Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . First, you might want to see the basic ways to help FastAPI and get help . Developing If ... ed by the tests, and notice if there is any region missing. Docs First, make sure you set up your environment as described above, that will install all the requirements. Docs live During local development, there is a script that builds the site and ch ... some pages. Let's say you want to add translations for Creole, and it's not yet there in the docs. Checking the link from above, the code for "Creole" is ht . The next step is to run the script to generate a new translation directory: // Use the comm ... rst pull request with those two files, docs/ht/mkdocs.yml and docs/ht/index.md . ? Preview the result As already mentioned above, you can use the ./scripts/docs.py with the live command to preview the results (or mkdocs serve ). Once you are done, you ...
https://man.mtool.work/fastapi/0.115/contributing/
Using Dataclasses 9752
Using Dataclasses Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . FastAPI is built on top of Pydantic , and I have been showing you how to use Pydantic models to d ... turn item This is still supported thanks to Pydantic , as it has internal support for dataclasses . So, even with the code above that doesn't use Pydantic explicitly, FastAPI is using Pydantic to convert those standard dataclasses to Pydantic's own fl ... h other type annotations in many different combinations to form complex data structures. Check the in-code annotation tips above to see more specific details. Learn More You can also combine dataclasses with other Pydantic models, inherit from them, i ...
https://man.mtool.work/fastapi/0.115/advanced/dataclasses/
SQL (Relational) Databases 9456
SQL (Relational) Databases Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . FastAPI doesn't require you to use a SQL (relational) database. But you can use any data ... e database. You would have one single engine object for all your code to connect to the same database. Python 3.10+ # Code above omitted ? sqlite_file_name = "database.db" sqlite_url = f "sqlite:/// { sqlite_file_name } " connect_args = { "check_same_ ... unction that uses SQLModel.metadata.create_all(engine) to create the tables for all the table models . Python 3.10+ # Code above omitted ? def create_db_and_tables (): SQLModel . metadata . create_all ( engine ) # Code below omitted ? ? Full file prev ... ate an Annotated dependency SessionDep to simplify the rest of the code that will use this dependency. Python 3.10+ # Code above omitted ? def get_session (): with Session ( engine ) as session : yield session SessionDep = Annotated [ Session , Depend ...
https://man.mtool.work/fastapi/0.115/tutorial/sql-databases/
GraphQL 8568
GraphQL 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 ASGI standard, it's very easy to integrate any GraphQL library also compatible w ... arn more about GraphQL in the official GraphQL documentation . You can also read more about each those libraries described above in their links. ...
https://man.mtool.work/fastapi/0.115/how-to/graphql/
OpenAPI Callbacks 8272
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 ... ce received" } Create the callback path operation To create the callback path operation use the same APIRouter you created above. It should look just like a normal FastAPI path operation : It should probably have a declaration of the body it should re ... ) needed (the one(s) that the external developer should implement in the external API ) in the callback router you created above. Now use the parameter callbacks in your API's path operation decorator to pass the attribute .routes (that's actually jus ...
https://man.mtool.work/fastapi/0.115/advanced/openapi-callbacks/
Configure Swagger UI 8272
Configure Swagger UI Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . You can configure some extra Swagger UI parameters . To configure them, pass the swagger_ui_pa ... nfiguration parameters appropriate for most of the use cases. It includes these default configurations: Python 3.8+ # Code above omitted ? swagger_ui_default_parameters : Annotated [ Dict [ str , Any ], Doc ( """ Default configurations for Swagger UI. ... em from Python code directly. If you need to use JavaScript-only configurations like those, you can use one of the methods above. Override all the Swagger UI path operation and manually write any JavaScript you need. ...
https://man.mtool.work/fastapi/0.115/how-to/configure-swagger-ui/
Repository Management Tasks 8272
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 ... not used by the latest-changes GitHub Action, so it won't be used in the release notes. Please make sure one of the labels above is added. Add Labels to Translation PRs When there's a PR for a translation, apart from adding the lang-all label, also ad ... eak the PR a bit before merging it. For the other languages, confirm that: The title is correct following the instructions above. It has the labels lang-all and lang-{lang code} . The PR changes only one Markdown file adding a translation. Or in some ...
https://man.mtool.work/fastapi/0.115/management-tasks/
PREV 1 2 NEXT