Results of 1 - 3 of about 3 for BaseSettings (0.004 sec.)
- Settings and Environment Variables 11886
- Settings and Environment Variables Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . In many cases your application could need some external settings or configuratio
...ackage so that you can choose to install it or not if you don't need that functionality. Create the Settings object Import BaseSettings from Pydantic and create a sub-class, very much like with a Pydantic model. The same way as with Pydantic models, you decl...l validations with Field() . Pydantic v2 Pydantic v1 Python 3.8+ from fastapi import FastAPI from pydantic_settings import BaseSettings class Settings ( BaseSettings ): app_name : str = "Awesome API" admin_email : str items_per_user : int = 50 settings = Set...in_email" : settings . admin_email , "items_per_user" : settings . items_per_user , } Info In Pydantic v1 you would import BaseSettings directly from pydantic instead of from pydantic_settings . Python 3.8+ from fastapi import FastAPI from pydantic import Ba... - https://man.mtool.work/fastapi/0.115/advanced/settings/
- 条件付き OpenAPI 8315
- 条件付き OpenAPI 必要であれば、設定と環境変数を利用して、環境に応じて条件付きでOpenAPIを構成することが可能です。また、完全にOpenAPIを無効にすることもできます。 セキュリティとAPI、およびドキュメントについて 本番環境においてドキュメントのUIを
...ticの設定を使用して簡単に切り替えられます。 例えば、 Python 3.8+ from fastapi import FastAPI from pydantic_settings import BaseSettings class Settings ( BaseSettings ): openapi_url : str = "/openapi.json" settings = Settings () app = FastAPI ( openapi_url =... - https://man.mtool.work/fastapi/0.115/how-to/conditional-openapi/
- Release Notes 7664
- Release Notes Latest Changes 0.115.11 Fixes ? Add docs examples and tests (support) for Annotated custom validations, like AfterValidator , revert #13440 . PR #13442 by @tiangolo . New docs: Query Parameters and String Validations - Custom
...tional optional package (included in "fastapi[all]" ). To use settings you should now import from pydantic_settings import BaseSettings instead of importing from pydantic directly. You can read more about it in the docs for Settings and Environment Variables... - https://man.mtool.work/fastapi/0.115/release-notes/
PREV
1
NEXT